LabStatus

class controller.models.v1.lab.LabStatus(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)

Bases: Enum

Possible states the user’s lab may be in.

This is not directly equivalent to pod phases. It is instead intended to capture the status of the lab from an infrastructure standpoint, reflecting the current intent of the controller. Most notably, labs that have stopped running for any reason (failure or success) use the terminated status. The failed status is reserved for failed Kubernetes operations or missing or invalid Kubernetes objects.

Attributes Summary

FAILED

PENDING

RUNNING

TERMINATED

TERMINATING

Methods Summary

from_phase(phase)

Convert a Kubernetes pod phase to a lab status.

Attributes Documentation

FAILED = 'failed'
PENDING = 'pending'
RUNNING = 'running'
TERMINATED = 'terminated'
TERMINATING = 'terminating'

Methods Documentation

classmethod from_phase(phase)

Convert a Kubernetes pod phase to a lab status.

Be aware that it is not possible to detect Kubernetes pods that are in the process of being terminated by looking only at the phase (Terminating is not a pod phase).

Parameters:

phase (PodPhase) – Kubernetes pod phase, from the Pod object.

Returns:

Corresponding lab status.

Return type:

LabStatus