WatchEvent

class controller.storage.kubernetes.watcher.WatchEvent(action, object)

Bases: Generic[T]

Parsed event from a Kubernetes watch.

This model is intended only for use within the Kubernetes storage layer. It is interpreted by the callers of the generic watch class inside the per-object Kubernetes storage classes.

Parameters:

Methods Summary

from_event(event, object_type)

Create a WatchEvent from a watch event.

Methods Documentation

classmethod from_event(event, object_type)

Create a WatchEvent from a watch event.

Parameters:
  • event (dict[str, Any]) – Event as returned by the Kubernetes watch API.

  • object_type (type[TypeVar(T)]) – Expected type of the object.

Raises:

TypeError – Raised if the type of the object in the watch event was incorrect.

Return type:

Self