validator

package
v1.16.2 Latest Latest
Warning

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

Go to latest
Published: Sep 20, 2024 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrTopLevelDescriptionFound = errors.New("top-level description field found")

ErrTopLevelDescriptionFound is the error returned if a policy contains a top-level description field. Instead this field should be moved to under (Rule).Description.

Functions

This section is empty.

Types

type ErrUnknownFields

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

ErrUnknownFields is an error representing the condition where unknown fields were found within a policy during validation. Fields that are not expected to be in the policy will be put inside the "extras" slice.

func (ErrUnknownFields) Error

func (e ErrUnknownFields) Error() string

type ErrUnknownKind

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

ErrUnknownKind is an error representing an unknown Kubernetes object kind that is passed to the validator.

func (ErrUnknownKind) Error

func (e ErrUnknownKind) Error() string

type NPValidator

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

NPValidator is a validator structure used to validate CNP and CCNP.

func NewNPValidator

func NewNPValidator() (*NPValidator, error)

func (*NPValidator) ValidateCCNP

func (n *NPValidator) ValidateCCNP(ccnp *unstructured.Unstructured) error

ValidateCCNP validates the given CCNP accordingly the CCNP validation schema.

func (*NPValidator) ValidateCNP

func (n *NPValidator) ValidateCNP(cnp *unstructured.Unstructured) error

ValidateCNP validates the given CNP accordingly the CNP validation schema.

Jump to

Keyboard shortcuts

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