config

package
v1.1.1 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2025 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NoPropagationLabels []NoPropagationLabel

NoPropagationLabels is a configuration slice that contains all NoPropagationLabel labels that should cause objects to be ignored from propagation.

View Source
var UnpropagatedAnnotations []string

UnpropgatedAnnotations is a list of annotations on objects that should _not_ be propagated by HNC. Much like HNC itself, other systems (such as GKE Config Sync) use annotations to "claim" an object - such as deleting objects it doesn't recognize. By removing these annotations on propgated objects, HNC ensures that other systems won't attempt to claim the same object.

This value is controlled by the --unpropagated-annotation command line, which may be set multiple times.

View Source
var UnpropagatedLabels []string

UnpropgatedLabels is a list of labels on objects that should _not_ be propagated by HNC. Much like HNC itself, other systems (such as ArgoCD) use labels to "claim" an object - such as deleting objects it doesn't recognize. By removing these labels on propgated objects, HNC ensures that other systems won't attempt to claim the same object.

This value is controlled by the --unpropagated-label command line, which may be set multiple times.

Functions

func GetHNCNamespace

func GetHNCNamespace() string

GetHNCNamespace return the namespace where hnc-manager and hnc resources deployed

func IsManagedAnnotation

func IsManagedAnnotation(k string) bool

func IsManagedLabel

func IsManagedLabel(k string) bool

func IsManagedNamespace

func IsManagedNamespace(nm string) bool

IsManagedNamespace is the same as WhyUnmanaged but converts the response to a bool for convenience.

func NewClient

func NewClient(readOnly bool) cluster.NewClientFunc

func SetHNCNamespace

func SetHNCNamespace(ns string)

func SetManagedMeta

func SetManagedMeta(labels, annots []string) error

SetManagedMeta sets the regexes for the managed namespace labels and annotations. The function ensures that all strings are valid regexes, and that they do not attempt to select for HNC metadata.

func SetNamespaces

func SetNamespaces(regex string, excluded ...string)

func ValidateManagedAnnotations

func ValidateManagedAnnotations(annotations []api.MetaKVP) field.ErrorList

func ValidateManagedLabels

func ValidateManagedLabels(labels []api.MetaKVP) field.ErrorList

func WhyUnmanaged

func WhyUnmanaged(nm string) string

WhyUnamanged returns a human-readable message explaining why the given namespace is unmanaged, or an empty string if it *is* managed.

Types

type NoPropagationLabel

type NoPropagationLabel struct {
	Key   string
	Value string
}

NoPropagationLabel specifies a label Key and Value which will cause an object to be excluded from propagation if the object defines that label with this specific value.

Jump to

Keyboard shortcuts

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