Documentation
¶
Overview ¶
Package util contains shared functionality for constraints and constraint templates.
Index ¶
- func AnnotateErrors(obj *unstructured.Unstructured, msgs ...string)
- func AnnotateReconciling(obj *unstructured.Unstructured, msgs ...string)
- func AnnotationsChanged(newObj, oldObj *unstructured.Unstructured) bool
- func FormatErrors(id string, pces []PolicyControllerError) []string
- func ResetAnnotations(obj *unstructured.Unstructured)
- func UnmarshalStatus(obj unstructured.Unstructured, status interface{}) error
- type PolicyControllerError
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnnotateErrors ¶
func AnnotateErrors(obj *unstructured.Unstructured, msgs ...string)
AnnotateErrors sets the error status annotation to the given error messages.
func AnnotateReconciling ¶
func AnnotateReconciling(obj *unstructured.Unstructured, msgs ...string)
AnnotateReconciling sets the reconciling status annotation to the given reasons.
func AnnotationsChanged ¶
func AnnotationsChanged(newObj, oldObj *unstructured.Unstructured) bool
AnnotationsChanged returns true if the status annotations between the two resources.
func FormatErrors ¶
func FormatErrors(id string, pces []PolicyControllerError) []string
FormatErrors flattens the given errors into a string array.
func ResetAnnotations ¶
func ResetAnnotations(obj *unstructured.Unstructured)
ResetAnnotations removes all status annotations.
func UnmarshalStatus ¶
func UnmarshalStatus(obj unstructured.Unstructured, status interface{}) error
UnmarshalStatus populates the given struct from the given unstructured data.
Types ¶
type PolicyControllerError ¶
type PolicyControllerError struct { Code string `json:"code"` Message string `json:"message"` Location string `json:"location,omitempty"` }
PolicyControllerError is the shared error schema for Gatekeeper constraints and constraint templates.
Click to show internal directories.
Click to hide internal directories.