status

package
v0.0.7 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConditionsFromUnstructured

func ConditionsFromUnstructured(unstrObj *unstructured.Unstructured) ([]metav1.Condition, error)

ConditionsFromUnstructured fetches all of the status.conditions from an unstructured object and returns them as a slice of metav1.Condition. The status.conditions field is expected to be a slice of map[string]any which can be cast into a metav1.Condition.

func ObjKindName

func ObjKindName(unstrObj *unstructured.Unstructured) (name, kind string)

Types

type ResourceConditions

type ResourceConditions struct {
	Kind       string
	Name       string
	Conditions []metav1.Condition
}

func GetResourceConditions

func GetResourceConditions(
	ctx context.Context, namespace string, dynamicClient dynamic.Interface,
	gvr schema.GroupVersionResource, labelSelector string,
) (resourceConditions *ResourceConditions, err error)

GetResourceConditions fetches the conditions from a resource identified by the provided GroupVersionResource and labelSelector. The function returns a ResourceConditions struct containing the name/kind of the resource and the conditions. If the resource is not found, returns a ResourceNotFoundError which can be checked by the caller to prevent reconciliation loops.

type ResourceNotFoundError

type ResourceNotFoundError struct {
	Resource string
}

func (ResourceNotFoundError) Error

func (e ResourceNotFoundError) Error() string

Jump to

Keyboard shortcuts

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