Documentation ¶
Index ¶
- Variables
- func GetHNCNamespace() string
- func IsManagedAnnotation(k string) bool
- func IsManagedLabel(k string) bool
- func IsManagedNamespace(nm string) bool
- func NewClient(readOnly bool) cluster.NewClientFunc
- func SetHNCNamespace(ns string)
- func SetManagedMeta(labels, annots []string) error
- func SetNamespaces(regex string, excluded ...string)
- func ValidateManagedAnnotations(annotations []api.MetaKVP) field.ErrorList
- func ValidateManagedLabels(labels []api.MetaKVP) field.ErrorList
- func WhyUnmanaged(nm string) string
- type NoPropagationLabel
Constants ¶
This section is empty.
Variables ¶
var NoPropagationLabels []NoPropagationLabel
NoPropagationLabels is a configuration slice that contains all NoPropagationLabel labels that should cause objects to be ignored from propagation.
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 IsManagedLabel ¶ added in v1.0.0
func IsManagedNamespace ¶
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
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 ValidateManagedAnnotations ¶ added in v1.0.0
func ValidateManagedLabels ¶ added in v1.0.0
func WhyUnmanaged ¶
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
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.