Interface EditReplacePatchable<T>

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      T accept​(Consumer<T> function)
      Issues a JSON patch against the item based upon the changes made by the function provided as argument
      T edit​(io.fabric8.kubernetes.api.builder.Visitor... visitors)
      Issues a JSON patch against the item based upon the changes made to the object by the visitors.
      <V> T edit​(Class<V> visitorType, io.fabric8.kubernetes.api.builder.Visitor<V> visitor)
      Issues a JSON patch against the item based upon the changes made to the object by the visitor.
      T edit​(UnaryOperator<T> function)
      Issues a JSON patch against the item based upon the changes made to the object returned by the function.
      T patch()
      Update field(s) of a resource using a JSON patch which will be computed using the latest server state as the base.
      T patch​(PatchContext patchContext)
      Update field(s) of a resource using type specified in PatchContext(defaults to strategic merge if not specified).
      T patch​(PatchContext patchContext, String patch)
      Update field(s) of a resource using type specified in PatchContext(defaults to strategic merge if not specified).
      T patch​(PatchContext patchContext, T item)
      Update field(s) of a resource using type specified in PatchContext(defaults to strategic merge if not specified).
      default T patch​(String patch)
      Update field(s) of a resource using strategic merge patch.
      default T patch​(T item)
      Update field(s) of a resource using a JSON patch.
    • Method Detail

      • edit

        T edit​(UnaryOperator<T> function)
        Issues a JSON patch against the item based upon the changes made to the object returned by the function.

        It is generally convenient to use a Builder constructed off of the item.

        Parameters:
        function - to modify the item
        Returns:
        returns deserialized version of api server response
      • edit

        T edit​(io.fabric8.kubernetes.api.builder.Visitor... visitors)
        Issues a JSON patch against the item based upon the changes made to the object by the visitors.
        Parameters:
        visitors - to modify the Builder
        Returns:
        returns deserialized version of api server response
      • edit

        <V> T edit​(Class<V> visitorType,
                   io.fabric8.kubernetes.api.builder.Visitor<V> visitor)
        Issues a JSON patch against the item based upon the changes made to the object by the visitor.
        Parameters:
        visitorType - to create a TypedVisitor
        visitor - to modify the Builder
        Returns:
        returns deserialized version of api server response
      • accept

        T accept​(Consumer<T> function)
        Issues a JSON patch against the item based upon the changes made by the function provided as argument
        Parameters:
        function - to modify the item
        Returns:
        returns deserialized version of api server response
      • patch

        default T patch​(T item)
        Update field(s) of a resource using a JSON patch. The patch is computed against the context item.

        It is the same as calling patch(PatchContext, Object) with PatchType.JSON specified.

        WARNING: If no context item is available the latest version of that resource will be used as the base to compute the diff. If you did not intend for the latest version to be your base, this may overwrite concurrent changes (between when you obtained your item and the current state) in an unexpected way.

        Consider using edit, which allows for a known base, and a builder instead.

        WARNING: For some resource types there is an attempt to make this operation more like an apply by considering implicit server side state as not being part of the patch. This behavior will be removed in future versions, you should instead construct the resource to be patched from a resource obtained from the api server or use patch method that is tolerant to missing state, or ServerSideApplicable.serverSideApply()

        Parameters:
        item - to be patched with patched values
        Returns:
        returns deserialized version of api server response
      • patch

        T patch​(PatchContext patchContext,
                T item)
        Update field(s) of a resource using type specified in PatchContext(defaults to strategic merge if not specified). WARNING: For a JSON patch and some resource types there is an attempt to make this operation more like an apply by considering implicit server side state as not being part of the patch. This behavior will be removed in future versions, you should instead construct the resource to be patched from a resource obtained from the api server or use patch method that is tolerant to missing state, or ServerSideApplicable.serverSideApply()

        Parameters:
        item - to be patched with patched values
        patchContext - PatchContext for patch request
        Returns:
        returns deserialized version of api server response
      • patch

        default T patch​(String patch)
        Update field(s) of a resource using strategic merge patch.
        Parameters:
        patch - The patch to be applied to the resource JSON file.
        Returns:
        returns deserialized version of api server response
      • patch

        T patch​(PatchContext patchContext,
                String patch)
        Update field(s) of a resource using type specified in PatchContext(defaults to strategic merge if not specified).
        Parameters:
        patchContext - PatchContext for patch request
        patch - The patch to be applied to the resource JSON file.
        Returns:
        updated object
      • patch

        T patch()
        Update field(s) of a resource using a JSON patch which will be computed using the latest server state as the base.

        It is the same as calling patch(PatchContext) with PatchType.JSON specified.

        WARNING: If you did not intend for the latest version to be your base, this may overwrite concurrent changes (between when you obtained your item and the current state) in an unexpected way.

        Consider using edit instead. WARNING: For some resource types there is an attempt to make this operation more like an apply by considering implicit server side state as not being part of the patch. This behavior will be removed in future versions, you should instead construct the resource to be patched from a resource obtained from the api server or use patch method that is tolerant to missing state, or ServerSideApplicable.serverSideApply()

        Returns:
        returns deserialized version of api server response
      • patch

        T patch​(PatchContext patchContext)
        Update field(s) of a resource using type specified in PatchContext(defaults to strategic merge if not specified).

        For use when you are providing a complete object to be patched: resource(item).patch(PatchContext.of(PatchType.SERVER_SIDE_APPLY))

        • PatchType.JSON - will create a JSON patch using the latest server state as the base
        • PatchType.JSON_MERGE - will send the serialization of the item as a JSON MERGE patch. Set the resourceVersion to null to prevent optimistic locking.
        • PatchType.STRATEGIC_MERGE - will send the serialization of the item as a STRATEGIC MERGE patch. Set the resourceVersion to null to prevent optimistic locking.
        • PatchType.SERVER_SIDE_APPLY - will send the serialization of the item as a SERVER SIDE APPLY patch. You may explicitly set the PatchContext.getFieldManager() as well to override the default.
        WARNING: For a JSON patch and some resource types there is an attempt to make this operation more like an apply by considering implicit server side state as not being part of the patch. This behavior will be removed in future versions, you should instead construct the resource to be patched from a resource obtained from the api server or use patch method that is tolerant to missing state, or ServerSideApplicable.serverSideApply()

        Parameters:
        patchContext - PatchContext for patch request
        Returns:
        returns deserialized version of api server response