Skip to main content

K8sStatusWriterWrapper

No overview available.

Attributes

AttributeTypeDescription
StatusWriterclient.StatusWriterThis field embeds a client.StatusWriter, providing the K8sStatusWriterWrapper with methods to update the status of Kubernetes resources.

Methods


Update()

@classmethod
def Update(
ctx: context.Context,
obj: client.Object,
opts: client.SubResourceUpdateOption
) - > error

Updates the status subresource of the given Kubernetes object. This method is used to modify only the status field of an object without affecting its spec or metadata.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and timeouts.
objclient.ObjectThe Kubernetes object whose status subresource is to be updated. The object must contain the desired status.
optsclient.SubResourceUpdateOptionOptions for the update operation, such as field managers or dry run settings.

Returns

TypeDescription
errorAn error if the update operation fails, otherwise nil.

Patch()

@classmethod
def Patch(
ctx: context.Context,
obj: client.Object,
patch: client.Patch,
opts: client.SubResourcePatchOption
) - > error

Patches the status subresource of the given Kubernetes object. This method applies a partial update to the status field, allowing for efficient modification of specific status attributes.

Parameters

NameTypeDescription
ctxcontext.ContextThe context for the request, used for cancellation and timeouts.
objclient.ObjectThe Kubernetes object whose status subresource is to be patched. The object's metadata (name, namespace) identifies the target, and its status field may contain the current state for strategic merge patches.
patchclient.PatchThe patch to apply to the object's status subresource. This can be a strategic merge patch, JSON merge patch, or JSON patch.
optsclient.SubResourcePatchOptionOptions for the patch operation, such as field managers or dry run settings.

Returns

TypeDescription
errorAn error if the patch operation fails, otherwise nil.