status

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 22, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConditionStatus

type ConditionStatus struct {
	*metav1.Condition
	// CondStatus is a pointer to the underlying condition status.
	// We're using the pointer to allow modifying the status.
	CondStatus *Status `json:"health"`
}

func GetCondition

func GetCondition(conditions []ConditionStatus, condType string) *ConditionStatus

GetCondition returns the condition with the given type. If the condition is not found, it returns nil.

func (*ConditionStatus) DeepCopy added in v0.3.0

func (in *ConditionStatus) DeepCopy() *ConditionStatus

func (ConditionStatus) Status

func (cs ConditionStatus) Status() Status

type Object

type Object struct {
	metav1.TypeMeta
	metav1.ObjectMeta
	Unstructured *unstructured.Unstructured
}

Object is a common representation of a Kubernetes object with the most common fields across all objects. It also allows access to the raw object.

func NewObjectFromUnstructured

func NewObjectFromUnstructured(unst *unstructured.Unstructured) (*Object, error)

type ObjectStatus

type ObjectStatus struct {
	Object      *Object           // the subject of the status
	ObjStatus   Status            // overall status of the object
	SubStatuses []ObjectStatus    // statuses of the sub-objects (e.g. pods of a replicaset)
	Conditions  []ConditionStatus // conditions of the object
}

ObjectStatus combines the object with status-related information.

func OkStatus

func OkStatus(obj *Object, subStatuses []ObjectStatus) ObjectStatus

func UnknownStatus

func UnknownStatus(obj *Object) ObjectStatus

func UnknownStatusWithError

func UnknownStatusWithError(obj *Object, err error) ObjectStatus

func (ObjectStatus) Status

func (os ObjectStatus) Status() Status

type Result

type Result int

Result reduces the status of an object to a single value.

const (
	Unknown Result = iota
	Ok
	Warning
	Error
)

func (Result) MarshalJSON added in v0.3.0

func (r Result) MarshalJSON() ([]byte, error)

func (Result) String

func (s Result) String() string

type Status

type Status struct {
	Result      Result `json:"result"`        // mapping to Result enum
	Progressing bool   `json:"progressing"`   // true if the object is still progressing
	Status      string `json:"-"`             // human readable status
	Err         error  `json:"err,omitempty"` // error appeared during the evaluation
}

Status is the core structure representing the status of an object.

func (*Status) DeepCopy added in v0.3.0

func (in *Status) DeepCopy() *Status

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳