KubernetesObjectCreator#

class controller.storage.kubernetes.creator.KubernetesObjectCreator(*, create_method, read_method, object_type, kind, logger)#

Bases: Generic[T]

Generic Kubernetes object storage supporting create and read.

This class provides a wrapper around any Kubernetes object type that implements create and read operations with logging and exception conversion.

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:

Methods Summary

create(namespace, body, timeout)

Create a new Kubernetes object.

read(name, namespace, timeout)

Read a Kubernetes object.

Methods Documentation

async create(namespace, body, timeout)#

Create a new Kubernetes object.

Parameters:
Raises:

KubernetesError – Raised for exceptions from the Kubernetes API server.

Return type:

None

async read(name, namespace, timeout)#

Read a Kubernetes object.

Parameters:
  • name (str) – Name of the object.

  • namespace (str) – Namespace of the object.

  • timeout (Timeout) – Timeout on operation.

Returns:

Kubernetes object, or None if it does not exist.

Return type:

Any or None

Raises:

KubernetesError – Raised for exceptions from the Kubernetes API server.