crd

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ExistingFieldRemoval

type ExistingFieldRemoval struct{}

func (*ExistingFieldRemoval) Name

func (efr *ExistingFieldRemoval) Name() string

func (*ExistingFieldRemoval) Validate

type Scope

type Scope struct{}

func (*Scope) Name

func (s *Scope) Name() string

func (*Scope) Validate

type StoredVersionRemoval

type StoredVersionRemoval struct{}

func (*StoredVersionRemoval) Name

func (svr *StoredVersionRemoval) Name() string

func (*StoredVersionRemoval) Validate

type Validation

type Validation interface {
	// Validate performs the validation, returning an error if the
	// new revision is incompatible with the old revision of the CustomResourceDefinition
	Validate(old, new *apiextensionsv1.CustomResourceDefinition) ValidationResult

	// Name is a human-readable name for this validation
	Name() string
}

Validation is a representation of a validation that is run against two revisions of a CustomResourceDefinition

type ValidationResult

type ValidationResult interface {
	Error(printDepth int) error
	JSON() ([]byte, error)
	YAML() ([]byte, error)
}

type Validator

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

Validator validates Kubernetes CustomResourceDefinitions using the configured validations

func NewValidator

func NewValidator(opts ...ValidatorOption) *Validator

func (*Validator) Validate

Validate runs the validations configured in the Validator

type ValidatorOption

type ValidatorOption func(*Validator)

func WithValidations

func WithValidations(validations ...Validation) ValidatorOption

type ValidatorResult

type ValidatorResult struct {
	ValidationResults []ValidationResult `json:"results"`
}

func (*ValidatorResult) Error

func (vr *ValidatorResult) Error(printDepth int) error

func (*ValidatorResult) JSON

func (vr *ValidatorResult) JSON() ([]byte, error)

func (*ValidatorResult) YAML

func (vr *ValidatorResult) YAML() ([]byte, error)

Jump to

Keyboard shortcuts

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