constraints

package
v0.0.0-...-c2efb00 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: Apache-2.0 Imports: 2 Imported by: 7

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SemanticEqual

func SemanticEqual(c1 *unstructured.Unstructured, c2 *unstructured.Unstructured) bool

SemanticEqual returns whether the specs of the constraints are equal. It ignores status and most metadata because neither are relevant as to how a constraint is enforced. It is assumed that the author is comparing two constraints with the same GVK/namespace/name. Labels are compared because the labels of a constraint may impact functionality (e.g. whether a constraint is expected to be enforced by Kubernetes' Validating Admission Policy).

Types

type Matcher

type Matcher interface {
	// Match returns true if the Matcher's Constraint should run against the
	// passed review object.
	// Note that this is the review object returned by HandleReview.
	Match(review interface{}) (bool, error)
}

Matcher matches object review requests.

Jump to

Keyboard shortcuts

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