status

package
v0.3.27 Latest Latest
Warning

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

Go to latest
Published: May 27, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package status contains (kstatus-like) logic to compute the status of Kubernetes resources.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Status

type Status kstatus.Status
const (
	InProgressStatus  Status = Status(kstatus.InProgressStatus)
	FailedStatus      Status = Status(kstatus.FailedStatus)
	CurrentStatus     Status = Status(kstatus.CurrentStatus)
	TerminatingStatus Status = Status(kstatus.TerminatingStatus)
	NotFoundStatus    Status = Status(kstatus.NotFoundStatus)
	UnknownStatus     Status = Status(kstatus.UnknownStatus)
)

func (Status) String

func (s Status) String() string

type StatusAnalyzer

type StatusAnalyzer interface {
	// Compute the status of an object, usually by examining conditions and/or other fields of the object's status.
	ComputeStatus(object *unstructured.Unstructured) (Status, error)
}

The StatusAnalyzer interface models types which allow to extract a kstatus-compatible status from an object.

func NewStatusAnalyzer

func NewStatusAnalyzer(reconcilerName string) StatusAnalyzer

Create a default StatusAnalyzer implementation. This implementation uses kstatus internally, with the following modifications:

  • certain hints about the object's status type can be passed by setting the annotation '<reconcilerName>/status-hint' on the object, as a comma-separated list; if this list contains the value 'has-observed-generation', the object's status (where appropriate) will be enhanced with an observed generation of -1 before passing it to kstatus; if this list contains the value 'has-ready-condition', the object's status (where appropriate) will be enhanced by a ready condition with 'Unknown' state
  • jobs will be treated differently as with kstatus; other than kstatus, which considers jobs as ready if they are successfully started, this implementation waits for the JobComplete or JobFailed condidtion to be present on the job's status.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL