validating

package
v1.7.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2024 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ResourceHashCodeAnnotation           = "kruise.io/resourcedistribution.resource.hashcode"
	SourceResourceDistributionOfResource = "kruise.io/resourcedistribution.resource.from"
)

Variables

View Source
var (
	// HandlerGetterMap contains admission webhook handlers
	HandlerGetterMap = map[string]types.HandlerGetter{
		"validate-apps-kruise-io-v1alpha1-resourcedistribution": func(mgr manager.Manager) admission.Handler {
			return &ResourceDistributionCreateUpdateHandler{
				Client:  mgr.GetClient(),
				Decoder: admission.NewDecoder(mgr.GetScheme()),
			}
		},
	}
)

Functions

func ConvertToUnstructured

func ConvertToUnstructured(resourceObject runtime.Object) (resource *unstructured.Unstructured)

ConvertToUnstructured receive runtime.Object, return *unstructured.Unstructured reused by controller

func DeserializeResource

func DeserializeResource(resourceRawExtension *runtime.RawExtension, fldPath *field.Path) (resource runtime.Object, allErrs field.ErrorList)

DeserializeResource receive yaml of resource, return runtime.Object reused by controller

Types

type ResourceDistributionCreateUpdateHandler

type ResourceDistributionCreateUpdateHandler struct {
	Client client.Client

	// Decoder decodes objects
	Decoder *admission.Decoder
}

ResourceDistributionCreateUpdateHandler handles ResourceDistribution

func (*ResourceDistributionCreateUpdateHandler) Handle

Handle handles admission requests.

Jump to

Keyboard shortcuts

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