config

package
v1.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2023 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.

Functions

func GetHNCNamespace added in v1.1.0

func GetHNCNamespace() string

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

func IsManagedAnnotation added in v1.0.0

func IsManagedAnnotation(k string) bool

func IsManagedLabel added in v1.0.0

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 added in v1.1.0

func NewClient(readOnly bool) cluster.NewClientFunc

func SetHNCNamespace added in v1.1.0

func SetHNCNamespace(ns string)

func SetManagedMeta added in v1.0.0

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 added in v1.0.0

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

func ValidateManagedLabels added in v1.0.0

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 added in v1.1.0

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