operator-sdk: github.com/operator-framework/operator-sdk/pkg/status Index | Files

package status

import "github.com/operator-framework/operator-sdk/pkg/status"

Index

Package Files

conditions.go

type Condition Uses

type Condition struct {
    Type               ConditionType          `json:"type"`
    Status             corev1.ConditionStatus `json:"status"`
    Reason             ConditionReason        `json:"reason,omitempty"`
    Message            string                 `json:"message,omitempty"`
    LastTransitionTime metav1.Time            `json:"lastTransitionTime,omitempty"`
}

Condition represents an observation of an object's state. Conditions are an extension mechanism intended to be used when the details of an observation are not a priori known or would not apply to all instances of a given Kind.

Conditions should be added to explicitly convey properties that users and components care about rather than requiring those properties to be inferred from other observations. Once defined, the meaning of a Condition can not be changed arbitrarily - it becomes part of the API, and has the same backwards- and forwards-compatibility concerns of any other part of the API.

func (*Condition) DeepCopyInto Uses

func (c *Condition) DeepCopyInto(cpy *Condition)

DeepCopyInto copies in into out.

func (Condition) IsFalse Uses

func (c Condition) IsFalse() bool

IsFalse returns whether the condition status is "False".

func (Condition) IsTrue Uses

func (c Condition) IsTrue() bool

IsTrue Condition whether the condition status is "True".

func (Condition) IsUnknown Uses

func (c Condition) IsUnknown() bool

IsUnknown returns whether the condition status is "Unknown".

type ConditionReason Uses

type ConditionReason string

ConditionReason is intended to be a one-word, CamelCase representation of the category of cause of the current status. It is intended to be used in concise output, such as one-line kubectl get output, and in summarizing occurrences of causes.

type ConditionType Uses

type ConditionType string

ConditionType is the type of the condition and is typically a CamelCased word or short phrase.

Condition types should indicate state in the "abnormal-true" polarity. For example, if the condition indicates when a policy is invalid, the "is valid" case is probably the norm, so the condition should be called "Invalid".

type Conditions Uses

type Conditions []Condition

Conditions is a set of Condition instances.

func NewConditions Uses

func NewConditions(conds ...Condition) Conditions

NewConditions initializes a set of conditions with the given list of conditions.

func (Conditions) GetCondition Uses

func (conditions Conditions) GetCondition(t ConditionType) *Condition

GetCondition searches the set of conditions for the condition with the given ConditionType and returns it. If the matching condition is not found, GetCondition returns nil.

func (Conditions) IsFalseFor Uses

func (conditions Conditions) IsFalseFor(t ConditionType) bool

IsFalseFor searches the set of conditions for a condition with the given ConditionType. If found, it returns `condition.IsFalse()`. If not found, it returns false.

func (Conditions) IsTrueFor Uses

func (conditions Conditions) IsTrueFor(t ConditionType) bool

IsTrueFor searches the set of conditions for a condition with the given ConditionType. If found, it returns `condition.IsTrue()`. If not found, it returns false.

func (Conditions) IsUnknownFor Uses

func (conditions Conditions) IsUnknownFor(t ConditionType) bool

IsUnknownFor searches the set of conditions for a condition with the given ConditionType. If found, it returns `condition.IsUnknown()`. If not found, it returns true.

func (Conditions) MarshalJSON Uses

func (conditions Conditions) MarshalJSON() ([]byte, error)

MarshalJSON marshals the set of conditions as a JSON array, sorted by condition type.

func (*Conditions) RemoveCondition Uses

func (conditions *Conditions) RemoveCondition(t ConditionType) bool

RemoveCondition removes the condition with the given ConditionType from the conditions set. If no condition with that type is found, RemoveCondition returns without performing any action. If the passed condition type is not found in the set of conditions, RemoveCondition returns false.

func (*Conditions) SetCondition Uses

func (conditions *Conditions) SetCondition(newCond Condition) bool

SetCondition adds (or updates) the set of conditions with the given condition. It returns a boolean value indicating whether the set condition is new or was a change to the existing condition with the same type.

Package status imports 5 packages (graph) and is imported by 3 packages. Updated 2020-04-07. Refresh now. Tools for package owners.