tester

package
v3.16.2 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	// MustExist means that an object must exist at the given path entry.
	MustExist = Condition("MustExist")
	// MustNotExist means that an object must not exist at the given path entry.
	MustNotExist = Condition("MustNotExist")
)

Variables

View Source
var (
	ErrPrefix   = errors.New("all subpaths must be a prefix of the `location` value of the mutation")
	ErrConflict = errors.New("conflicting path test conditions")
)

Base errors for validating path tests.

Functions

This section is empty.

Types

type Condition

type Condition string

Condition describes whether the path either MustExist or MustNotExist in the original object +kubebuilder:validation:Enum=MustExist;MustNotExist

func StringToCondition

func StringToCondition(s string) (Condition, error)

StringToCondition translates a user-provided string into a Test Condition.

type Test

type Test struct {
	SubPath   parser.Path
	Condition Condition
}

Test describes a condition that the object must satisfy.

type Tester

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

Tester knows whether it's okay that an object exists at a given path depth.

func New

func New(location parser.Path, tests []Test) (*Tester, error)

New creates a new Tester object.

func (*Tester) DeepCopy

func (pt *Tester) DeepCopy() *Tester

DeepCopy returns a deep copy of the tester.

func (*Tester) ExistsOkay

func (pt *Tester) ExistsOkay(depth int) bool

ExistsOkay returns true if it's okay that an object exists.

func (*Tester) MissingOkay

func (pt *Tester) MissingOkay(depth int) bool

MissingOkay returns true if it's okay that an object is missing.

Jump to

Keyboard shortcuts

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