Documentation ¶
Overview ¶
Package function contains common defaulting and validating functions that can be imported and used in any admission controllers. It provides examples of the functions, but more common and generic functions can also be added to this package for reuse.
Index ¶
- func AddAnnotations(cli client.Client, annotations map[string]string) admission.DefaultFunc
- func AddClusterVersionAnnotation(d discovery.DiscoveryInterface) admission.DefaultFunc
- func AddLabels(cli client.Client, labels map[string]string) admission.DefaultFunc
- func ValidateLabels(obj client.Object, labels map[string]string) error
- func ValidateLabelsCreate(labels map[string]string) admission.ValidateCreateFunc
- func ValidateLabelsUpdate(labels map[string]string) admission.ValidateUpdateFunc
- func ValidateSingletonCreate(sf singleton.GetInstanceFunc, c client.Client) admission.ValidateCreateFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddAnnotations ¶
AddAnnotations is a generic defaulter method for adding annotations to any given object.
func AddClusterVersionAnnotation ¶
func AddClusterVersionAnnotation(d discovery.DiscoveryInterface) admission.DefaultFunc
AddClusterVersionAnnotation is a generic defaulter method for adding cluster version info on an object's annotations. This requires a discovery client to get the cluster info.
func ValidateLabels ¶
ValidateLabels takes an object and a set of labels and validates the object's labels based on the given set of labels. Unknown labels results in failure.
func ValidateLabelsCreate ¶
func ValidateLabelsCreate(labels map[string]string) admission.ValidateCreateFunc
func ValidateLabelsUpdate ¶
func ValidateLabelsUpdate(labels map[string]string) admission.ValidateUpdateFunc
func ValidateSingletonCreate ¶
func ValidateSingletonCreate(sf singleton.GetInstanceFunc, c client.Client) admission.ValidateCreateFunc
ValidateSingletonCreate allows singleton of an object type. If an instance of an object already exists, this will prevent creation of another object.
Types ¶
This section is empty.