kube

package
v1.8.6 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// CAPWClusterRoleLabelKey is the key for the label applied to a VM that was
	// created by CAPW.
	CAPWClusterRoleLabelKey = "capw.vmware.com/cluster.role" //nolint:gosec

	// CAPVClusterRoleLabelKey is the key for the label applied to a VM that was
	// created by CAPV.
	CAPVClusterRoleLabelKey = "capv.vmware.com/cluster.role"
)

Variables

This section is empty.

Functions

func HasCAPILabels added in v1.8.6

func HasCAPILabels(vmLabels map[string]string) bool

HasCAPILabels returns true if the VM has a label indicating it was created by Cluster API such as CAPW or CAPV.

func SyncGVKToObject added in v1.8.6

func SyncGVKToObject(obj runtime.Object, scheme *runtime.Scheme) error

SyncGVKToObject synchronizes the group, version, and kind for a given object back into the object by looking up the information from the provided scheme.

For more information, please see Update 1 from the following issue: https://github.com/kubernetes-sigs/controller-runtime/issues/2382.

func VMForControllerPredicate

func VMForControllerPredicate(
	c client.Client,
	log logr.Logger,
	controllerName string,
	opts VMForControllerPredicateOptions) predicate.Predicate

VMForControllerPredicate returns a predicate.Predicate that filters VirtualMachine resources and returns only those that map to a VirtualMachineClass resource that uses the provided controller.

Please note this predicate is schema agnostic and should work with all VM Operator API schema versions.

Types

type VMForControllerPredicateOptions

type VMForControllerPredicateOptions struct {
	MatchIfVMClassNotFound            bool
	MatchIfControllerNameFieldEmpty   bool
	MatchIfControllerNameFieldMissing bool
}

VMForControllerPredicateOptions is used to configure the behavior of the predicate created with VMForControllerPredicate.

Jump to

Keyboard shortcuts

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