KubernetesObjectDeleter#
- class controller.storage.kubernetes.deleter.KubernetesObjectDeleter(*, create_method, delete_method, list_method, read_method, object_type, kind, logger)#
Bases:
KubernetesObjectCreator
,Generic
[T
]Generic Kubernetes object storage supporting list and delete.
This class provides a wrapper around any Kubernetes object type that implements create, read, list, and delete with logging, exception conversion, and waiting for deletion to complete. It is separate from
KubernetesObjectCreator
primarily to avoid having to implement the list and delete methods in the mock for every object type we manage, even if we never call list and delete.This class is not meant to be used directly by code outside of the Kubernetes storage layer. Use one of the kind-specific watcher classes built on top of it instead.
- Parameters:
create_method (
Callable
[...
,Awaitable
[Any
]]) – Method to create this type of object.delete_method (
Callable
[...
,Awaitable
[Any
]]) – Method to delete this type of object.list_method (
Callable
[...
,Awaitable
[Any
]]) – Method to list all of this type of object.read_method (
Callable
[...
,Awaitable
[Any
]]) – Method to read this type of object.object_type (
type
[TypeVar
(T
, bound=KubernetesModel
)]) – Type of object being acted on.kind (
str
) – Kubernetes kind of object being acted on.logger (
BoundLogger
) – Logger to use.