Documentation
¶
Overview ¶
Package constraints provides utility functions for working with constraint resources.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SemanticEqualWithLabelsAndAnnotations ¶
func SemanticEqualWithLabelsAndAnnotations(c1 *unstructured.Unstructured, c2 *unstructured.Unstructured) bool
SemanticEqualWithLabelsAndAnnotations 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). Annotations are also compared as they may be used for audit logging and export functionality, even though they do not impact enforcement.