kubernetes

package
v0.4.9 Latest Latest
Warning

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

Go to latest
Published: Mar 28, 2024 License: GPL-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyCustomResourceDefinition

func ApplyCustomResourceDefinition(ctx context.Context, c client.Interface, crd *apiextv1.CustomResourceDefinition) error

ApplyCustomResourceDefinition is responsible for applying the CRD to the cluster

func ApplyCustomResourceDefinitions

func ApplyCustomResourceDefinitions(ctx context.Context, c client.Interface, list []*apiextv1.CustomResourceDefinition) error

ApplyCustomResourceDefinitions s responsible for applying a collection of CRDs

func ApplyCustomResourceRawDefinitions

func ApplyCustomResourceRawDefinitions(ctx context.Context, cc client.Interface, raw []byte) error

ApplyCustomResourceRawDefinitions reads the definitions from the raw bytes

func CheckCustomResourceDefinition

func CheckCustomResourceDefinition(ctx context.Context, c client.Interface, crd *apiextv1.CustomResourceDefinition) error

CheckCustomResourceDefinition ensures the CRD is ok to go

func CreateOrForceUpdate

func CreateOrForceUpdate(ctx context.Context, cc client.Client, resource client.Object) error

CreateOrForceUpdate either creates or forces the update of the resource

func CreateOrPatch

func CreateOrPatch(ctx context.Context, cc client.Client, resource client.Object) error

CreateOrPatch either creates or patches the resource

func DeleteIfExists

func DeleteIfExists(ctx context.Context, cc client.Client, resource client.Object) error

DeleteIfExists deletes the resource is it exists

func FindLatestPod

func FindLatestPod(list *v1.PodList) *v1.Pod

FindLatestPod returns the latest pod in the list

func GetIfExists

func GetIfExists(ctx context.Context, cc client.Client, object client.Object) (bool, error)

GetIfExists retrieves an object if it exists

func GetSecretIfExists added in v0.3.25

func GetSecretIfExists(ctx context.Context, cc client.Client, namespace, name string) (*v1.Secret, bool, error)

GetSecretIfExists retrieves a secret if it exists

func HumanDuration added in v0.3.4

func HumanDuration(d time.Duration) string

HumanDuration returns a more human friendly duration

func IsLabelSelectorMatch added in v0.3.4

func IsLabelSelectorMatch(source map[string]string, selector metav1.LabelSelector) (bool, error)

IsLabelSelectorMatch is used to check if the selectors matches the labels.

func IsSelectorMatch added in v0.3.4

func IsSelectorMatch(
	selector terraformv1alpha1.Selector,
	resourceLabels, namespaceLabels map[string]string) (bool, error)

IsSelectorMatch is used to check if the resource matches the selectors.

func NewExtentionsAPIClient

func NewExtentionsAPIClient(cfg *rest.Config) (client.Interface, error)

NewExtentionsAPIClient returns an extensions api client

func NewKubeClient added in v0.3.4

func NewKubeClient() (k8sclient.Interface, error)

NewKubeClient returns a kubernetes clientset

func NewRuntimeClient added in v0.3.4

func NewRuntimeClient(scheme *runtime.Scheme) (client.Client, error)

NewRuntimeClient returns a controller-runtime clientset

Types

This section is empty.

Jump to

Keyboard shortcuts

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