Documentation ¶
Index ¶
Constants ¶
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
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
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.