function

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2022 License: MIT Imports: 7 Imported by: 1

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddAnnotations

func AddAnnotations(cli client.Client, annotations map[string]string) admission.DefaultFunc

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 AddLabels

func AddLabels(cli client.Client, labels map[string]string) admission.DefaultFunc

AddLabels is a generic defaulter method for adding labels to any given object.

func ValidateLabels

func ValidateLabels(obj client.Object, labels map[string]string) error

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.

Jump to

Keyboard shortcuts

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