conditions

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Delete

func Delete(on Setter, conditionType string)

Delete removes the condition with the given type from the resource.

func Equal

func Equal(a, b metav1.Condition) bool

Equal returns true if the two conditions have the same type, status, reason, and message. It does not compare the last transition time or observed generation.

func Get

func Get(on Getter, conditionType string) *metav1.Condition

Get returns the condition with the given type from the resource. If the condition does not exist, nil is returned.

func Set

func Set(on Setter, conditions ...*metav1.Condition)

Set updates the conditions on the given resource. If a condition with the same type already exists, it is replaced. If the condition is new, it is appended to the list of conditions.

If the setter also implements v1.Object, the observed generation is set on the condition.

Types

type Getter

type Getter interface {
	// GetConditions returns the conditions on the resource.
	GetConditions() []metav1.Condition
}

Getter is an interface that allows getting conditions from a (sub)resource.

type Setter

type Setter interface {
	Getter

	// SetConditions sets the conditions on the resource.
	SetConditions(conditions []metav1.Condition)
}

Setter is an interface that allows setting conditions on a (sub)resource.

Jump to

Keyboard shortcuts

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