validation

package
v0.3.0-rc.2 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Module added in v0.1.2

func Module() fx.Option

Module provides fx module for Policy Custom Resource validator.

Types

type FxIn added in v0.1.3

type FxIn struct {
	fx.In
	Webhooks   *webhooks.K8sRegistry
	Validators []PolicySpecValidator `group:"policy-validators"`
}

FxIn is a struct that contains all dependencies for Policy Custom Resource validator.

type PolicySpecValidator added in v0.3.0

type PolicySpecValidator interface {
	ValidateSpec(
		ctx context.Context,
		name string,
		yamlSrc []byte,
	) (bool, string, error)
}

PolicySpecValidator is an interface for Policy Custom Resource validation.

type PolicyValidator added in v0.3.0

type PolicyValidator struct {
	// contains filtered or unexported fields
}

PolicyValidator validates the Policy Custom Resource.

func NewPolicyValidator added in v0.3.0

func NewPolicyValidator(validators []PolicySpecValidator) *PolicyValidator

NewPolicyValidator creates a new instance of PolicyValidator.

func (*PolicyValidator) ValidateObject added in v0.3.0

func (v *PolicyValidator) ValidateObject(
	ctx context.Context,
	req *admissionv1.AdmissionRequest,
) (ok bool, msg string, err error)

ValidateObject checks the validity of a object as a k8s object.

Jump to

Keyboard shortcuts

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