status

package
v0.0.0-...-d2b1218 Latest Latest
Warning

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

Go to latest
Published: Dec 9, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package status contains common status types used in maistra API +k8s:deepcopy-gen=package

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ComposeReconciledVersion

func ComposeReconciledVersion(operatorVersion string, generation int64) string

ComposeReconciledVersion returns a string for use in ReconciledVersion fields

func CurrentReconciledVersion

func CurrentReconciledVersion(generation int64) string

CurrentReconciledVersion returns a ReconciledVersion for this release of the operator

Types

type ComponentStatus

type ComponentStatus struct {
	StatusType `json:",inline"`

	// The name of the component this status pertains to.
	Resource string `json:"resource,omitempty"`

	// TODO: can we remove this? it's not used anywhere
	// The status of each resource that comprises this component.
	Resources []*StatusType `json:"children,omitempty"`
}

ComponentStatus represents the status of an object with children

func NewComponentStatus

func NewComponentStatus() *ComponentStatus

NewComponentStatus returns a new ComponentStatus object

func (*ComponentStatus) DeepCopy

func (in *ComponentStatus) DeepCopy() *ComponentStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentStatus.

func (*ComponentStatus) DeepCopyInto

func (in *ComponentStatus) DeepCopyInto(out *ComponentStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ComponentStatusList

type ComponentStatusList struct {
	//+optional
	ComponentStatus []ComponentStatus `json:"components,omitempty"`
}

func (*ComponentStatusList) DeepCopy

func (in *ComponentStatusList) DeepCopy() *ComponentStatusList

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ComponentStatusList.

func (*ComponentStatusList) DeepCopyInto

func (in *ComponentStatusList) DeepCopyInto(out *ComponentStatusList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*ComponentStatusList) FindComponentByName

func (s *ComponentStatusList) FindComponentByName(name string) *ComponentStatus

FindComponentByName returns the status for a specific component

type Condition

type Condition struct {

	// The type of this condition.
	Type ConditionType `json:"type,omitempty"`

	// The status of this condition. Can be True, False or Unknown.
	Status ConditionStatus `json:"status,omitempty"`

	// Unique, single-word, CamelCase reason for the condition's last transition.
	Reason ConditionReason `json:"reason,omitempty"`

	// Human-readable message indicating details about the last transition.
	Message string `json:"message,omitempty"`

	// Last time the condition transitioned from one status to another.
	LastTransitionTime metav1.Time `json:"lastTransitionTime,omitempty"`
}

A Condition represents a specific observation of the object's state.

func (*Condition) DeepCopy

func (in *Condition) DeepCopy() *Condition

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Condition.

func (*Condition) DeepCopyInto

func (in *Condition) DeepCopyInto(out *Condition)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*Condition) Matches

func (c *Condition) Matches(status ConditionStatus, reason ConditionReason, message string) bool

type ConditionReason

type ConditionReason string

ConditionReason represents a short message indicating how the condition came to be in its present state.

const (
	// ConditionReasonDeletionError ...
	ConditionReasonDeletionError ConditionReason = "DeletionError"
	// ConditionReasonInstallSuccessful ...
	ConditionReasonInstallSuccessful ConditionReason = "InstallSuccessful"
	// ConditionReasonInstallError ...
	ConditionReasonInstallError ConditionReason = "InstallError"
	// ConditionReasonReconcileSuccessful ...
	ConditionReasonReconcileSuccessful ConditionReason = "ReconcileSuccessful"
	// ConditionReasonValidationError ...
	ConditionReasonValidationError ConditionReason = "ValidationError"
	// ConditionReasonDependencyMissingError ...
	ConditionReasonDependencyMissingError ConditionReason = "DependencyMissingError"
	// ConditionReasonReconcileError ...
	ConditionReasonReconcileError ConditionReason = "ReconcileError"
	// ConditionReasonResourceCreated ...
	ConditionReasonResourceCreated ConditionReason = "ResourceCreated"
	// ConditionReasonSpecUpdated ...
	ConditionReasonSpecUpdated ConditionReason = "SpecUpdated"
	// ConditionReasonOperatorUpdated indicates that the SMCP is being reconciled
	// because the operator was upgraded
	ConditionReasonOperatorUpdated ConditionReason = "OperatorUpdated"
	// ConditionReasonUpdateSuccessful ...
	ConditionReasonUpdateSuccessful ConditionReason = "UpdateSuccessful"
	// ConditionReasonComponentsReady ...
	ConditionReasonComponentsReady ConditionReason = "ComponentsReady"
	// ConditionReasonComponentsNotReady ...
	ConditionReasonComponentsNotReady ConditionReason = "ComponentsNotReady"
	// ConditionReasonProbeError ...
	ConditionReasonProbeError ConditionReason = "ProbeError"
	// ConditionReasonPausingInstall ...
	ConditionReasonPausingInstall ConditionReason = "PausingInstall"
	// ConditionReasonPausingUpdate ...
	ConditionReasonPausingUpdate ConditionReason = "PausingUpdate"
	// ConditionReasonDeleting ...
	ConditionReasonDeleting ConditionReason = "Deleting"
	// ConditionReasonDeleted ...
	ConditionReasonDeleted ConditionReason = "Deleted"
)

type ConditionStatus

type ConditionStatus string

ConditionStatus represents the status of the condition

const (
	// ConditionStatusTrue represents completion of the condition, e.g.
	// Initialized=True signifies that initialization has occurred.
	ConditionStatusTrue ConditionStatus = "True"
	// ConditionStatusFalse represents incomplete status of the condition, e.g.
	// Initialized=False signifies that initialization has not occurred or has
	// failed.
	ConditionStatusFalse ConditionStatus = "False"
	// ConditionStatusUnknown represents unknown completion of the condition, e.g.
	// Initialized=Unknown signifies that initialization may or may not have been
	// completed.
	ConditionStatusUnknown ConditionStatus = "Unknown"
)

type ConditionType

type ConditionType string

ConditionType represents the type of the condition. Condition stages are: Installed, Reconciled, Ready

const (
	// ConditionTypeInstalled signifies the whether or not the controller has
	// installed the resources defined through the CR.
	ConditionTypeInstalled ConditionType = "Installed"
	// ConditionTypeReconciled signifies the whether or not the controller has
	// reconciled the resources defined through the CR.
	ConditionTypeReconciled ConditionType = "Reconciled"
	// ConditionTypeReady signifies the whether or not any Deployment, StatefulSet,
	// etc. resources are Ready.
	ConditionTypeReady ConditionType = "Ready"
)

type ResourceKey

type ResourceKey string

ResourceKey is a typedef for key used in ManagedGenerations. It is a string with the format: namespace/name=group/version,kind

func NewResourceKey

func NewResourceKey(o metav1.Object, t metav1.Type) ResourceKey

NewResourceKey for the object and type

func (ResourceKey) ToUnstructured

func (key ResourceKey) ToUnstructured() *unstructured.Unstructured

ToUnstructured returns a an Unstructured object initialized with Namespace, Name, APIVersion, and Kind fields from the ResourceKey

type StatusBase

type StatusBase struct {
	// Annotations is an unstructured key value map used to store additional,
	// usually redundant status information, such as the number of components
	// deployed by the ServiceMeshControlPlane (number is redundant because
	// you could just as easily count the elements in the ComponentStatus
	// array). The reason to add this redundant information is to make it
	// available to kubectl, which does not yet allow counting objects in
	// JSONPath expressions.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
}

func (*StatusBase) DeepCopy

func (in *StatusBase) DeepCopy() *StatusBase

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusBase.

func (*StatusBase) DeepCopyInto

func (in *StatusBase) DeepCopyInto(out *StatusBase)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StatusBase) GetAnnotation

func (s *StatusBase) GetAnnotation(name string) string

func (*StatusBase) RemoveAnnotation

func (s *StatusBase) RemoveAnnotation(name string)

func (*StatusBase) SetAnnotation

func (s *StatusBase) SetAnnotation(name string, value string)

type StatusType

type StatusType struct {

	// Represents the latest available observations of the object's current state.
	Conditions []Condition `json:"conditions,omitempty"`
}

StatusType represents the status for a control plane, component, or resource

func NewStatus

func NewStatus() StatusType

NewStatus returns a new StatusType object

func (*StatusType) DeepCopy

func (in *StatusType) DeepCopy() *StatusType

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new StatusType.

func (*StatusType) DeepCopyInto

func (in *StatusType) DeepCopyInto(out *StatusType)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*StatusType) GetCondition

func (s *StatusType) GetCondition(conditionType ConditionType) Condition

GetCondition removes a condition for the list of conditions

func (*StatusType) RemoveCondition

func (s *StatusType) RemoveCondition(conditionType ConditionType) *StatusType

RemoveCondition removes a condition for the list of conditions

func (*StatusType) SetCondition

func (s *StatusType) SetCondition(condition Condition) *StatusType

SetCondition sets a specific condition in the list of conditions

Jump to

Keyboard shortcuts

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