clientutil

package
v1.7.3 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	KubeoneComponentLabel = "kubeone.io/component"
)

Variables

This section is empty.

Functions

func AddLabels

func AddLabels(labels map[string]string, objects ...runtime.Object) []runtime.Object

func CRDsReadyCondition

func CRDsReadyCondition(ctx context.Context, client dynclient.Client, names []string) wait.ConditionFunc

CRDsReadyCondition generate a k8s.io/apimachinery/pkg/util/wait.ConditionFunc function to be used in k8s.io/apimachinery/pkg/util/wait.Poll* family of functions. It will check all provided GKs (GroupKinds) to exists and have Established status

func CreateOrReplace added in v1.4.0

func CreateOrReplace(ctx context.Context, c client.Client, obj client.Object, updaters ...Updater) error

CreateOrReplace makes it easy to "replace" objects

func CreateOrUpdate

func CreateOrUpdate(ctx context.Context, c client.Client, obj client.Object, updaters ...Updater) error

CreateOrUpdate makes it easy to "apply" objects to kubernetes API server

func DeleteIfExists added in v1.3.0

func DeleteIfExists(ctx context.Context, c client.Client, obj client.Object) error

DeleteIfExists makes it easy to "delete" Kubernetes objects if they exist

func LabelComponent

func LabelComponent(component string, objects ...runtime.Object) []runtime.Object

func PodsReadyCondition

func PodsReadyCondition(ctx context.Context, c dynclient.Client, listOpts dynclient.ListOptions) wait.ConditionFunc

PodsReadyCondition generate a k8s.io/apimachinery/pkg/util/wait.ConditionFunc function to be used in k8s.io/apimachinery/pkg/util/wait.Poll* family of functions. It will check all selected pods to have PodReady condition and phase PodRunning.

Types

type Updater

type Updater func(client.Client, client.Object)

func WithComponentLabel

func WithComponentLabel(componentname string) Updater

Jump to

Keyboard shortcuts

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