KubernetesResourceStatus#

class gafaelfawr.models.kubernetes.KubernetesResourceStatus(message, generation, reason, timestamp=<factory>)#

Bases: object

Represents the processing status of a Kubernetes resource.

This is returned as the result of the Kopf operator handlers for changes to a Kubernetes resource. Kopf will then put this information into the status field of the GafaelfawrServiceToken object.

Parameters:
  • message (str)

  • generation (int)

  • reason (StatusReason)

  • timestamp (TypeAliasType, default: <factory>)

Attributes Summary

generation

Generation of the resource that was processed.

message

Message associated with the transition.

reason

Reason for the status update.

timestamp

Time of the status event.

Methods Summary

failure(resource, message)

Create a status object for a failure.

to_dict()

Convert the status update to a dictionary for Kubernetes.

Attributes Documentation

generation: int = <dataclasses._MISSING_TYPE object>#

Generation of the resource that was processed.

message: str = <dataclasses._MISSING_TYPE object>#

Message associated with the transition.

reason: StatusReason = <dataclasses._MISSING_TYPE object>#

Reason for the status update.

timestamp: TypeAliasType = <dataclasses._MISSING_TYPE object>#

Time of the status event.

Methods Documentation

classmethod failure(resource, message)#

Create a status object for a failure.

Parameters:
  • service_token – Object being processed.

  • message (str) – Error message for the failure.

  • resource (KubernetesResource)

Returns:

Corresponding status object.

Return type:

KubernetesResourceStatus

to_dict()#

Convert the status update to a dictionary for Kubernetes.

Returns:

Information to store in the status field of the Kubernetes resource.

Return type:

dict