util

package
v1.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package util contains shared functionality for constraints and constraint templates.

Index

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.

Jump to

Keyboard shortcuts

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