v1alpha2

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: 5 Imported by: 24

Documentation

Overview

Package v1 contains API Schema definitions for the hnc v1 API group +kubebuilder:object:generate=true +groupName=hnc.x-k8s.io

Index

Constants

View Source
const (
	// HRQLabelCleanup is added to resources created by HRQ (specifically the RQ
	// singletons) for easier cleanup later by a selector.
	HRQLabelCleanup = MetaGroup + "/hrq"

	// NonPropagateAnnotation is added to RQ singletons so that they are not
	// overwritten by ancestors.
	NonPropagateAnnotation = AnnotationPropagatePrefix + "/none"

	// EventCannotWriteResourceQuota is for events when the reconcilers cannot
	// write ResourceQuota from an HRQ. Usually it means the HRQ has invalid
	// resource quota types. The error message will point to the HRQ object.
	EventCannotWriteResourceQuota string = "CannotWriteResourceQuota"
)
View Source
const (
	Singleton               = "hierarchy"
	HierarchyConfigurations = "hierarchyconfigurations"
)

Constants for types and well-known names

View Source
const (
	MetaGroup                 = "hnc.x-k8s.io"
	LabelInheritedFrom        = MetaGroup + "/inherited-from"
	FinalizerHasSubnamespace  = MetaGroup + "/hasSubnamespace"
	LabelTreeDepthSuffix      = ".tree." + MetaGroup + "/depth"
	AnnotationManagedBy       = MetaGroup + "/managed-by"
	AnnotationPropagatePrefix = "propagate." + MetaGroup

	AnnotationSelector     = AnnotationPropagatePrefix + "/select"
	AnnotationTreeSelector = AnnotationPropagatePrefix + "/treeSelect"
	AnnotationNoneSelector = AnnotationPropagatePrefix + "/none"
	AnnotationAllSelector  = AnnotationPropagatePrefix + "/all"

	// LabelManagedByStandard will eventually replace our own managed-by annotation (we didn't know
	// about this standard label when we invented our own).
	LabelManagedByApps = "app.kubernetes.io/managed-by"

	// LabelIncludedNamespace is the label added by HNC on the namespaces that
	// should be enforced by our validators.
	LabelIncludedNamespace = MetaGroup + "/included-namespace"
)

Constants for labels and annotations

View Source
const (
	// Condition types.
	ConditionActivitiesHalted string = "ActivitiesHalted"
	ConditionBadConfiguration string = "BadConfiguration"

	// Condition reasons. Please keep this list in alphabetical order. IF ADDING ANYTHING HERE, PLEASE
	// ALSO ADD THEM TO AllConditions, BELOW.
	ReasonAncestor                 string = "AncestorHaltActivities"
	ReasonAnchorMissing            string = "SubnamespaceAnchorMissing"
	ReasonDeletingCRD              string = "DeletingCRD"
	ReasonIllegalManagedAnnotation string = "IllegalManagedAnnotation"
	ReasonIllegalManagedLabel      string = "IllegalManagedLabel"
	ReasonIllegalParent            string = "IllegalParent"
	ReasonInCycle                  string = "InCycle"
	ReasonParentMissing            string = "ParentMissing"
)
View Source
const (
	// EventCannotPropagate is for events when a namespace contains an object that
	// couldn't be propagated *out* of the namespace, to one or more of its
	// descendants. If the object couldn't be propagated to *any* descendants - for
	// example, because it has a finalizer on it (HNC can't propagate objects with
	// finalizers), the error message will point to the object in this namespace.
	// Otherwise, if it couldn't be propagated to *some* descendant, the error
	// message will point to the descendant.
	EventCannotPropagate string = "CannotPropagateObject"
	// EventCannotUpdate is for events when a namespace has an object that couldn't
	// be propagated *into* this namespace - that is, it couldn't be created in
	// the first place, or it couldn't be updated. The error message will point to
	// the source namespace.
	EventCannotUpdate string = "CannotUpdateObject"
	// EventCannotGetSelector is for events when an object has annotations that cannot be
	// parsed into a valid selector
	EventCannotParseSelector string = "CannotParseSelector"
)
View Source
const (
	HNCConfigSingleton  = "config"
	HNCConfigSingletons = "hncconfigurations"
	RBACGroup           = "rbac.authorization.k8s.io"
	RoleResource        = "roles"
	RoleKind            = "Role"
	RoleBindingResource = "rolebindings"
	RoleBindingKind     = "RoleBinding"
)

Constants for resources and well-known names.

View Source
const (
	// Condition types.
	ConditionBadTypeConfiguration = "BadConfiguration"
	ConditionOutOfSync            = "OutOfSync"
	// NamespaceCondition is set if there are namespace conditions, which are set
	// in the HierarchyConfiguration objects. The condition reasons would be the
	// condition types in HierarchyConfiguration, e.g. "ActivitiesHalted".
	ConditionNamespace = "NamespaceCondition"

	// Condition reasons for BadConfiguration
	ReasonMultipleConfigsForType = "MultipleConfigurationsForType"
	ReasonResourceNotFound       = "ResourceNotFound"
	ReasonResourceNotNamespaced  = "ResourceNotNamespaced"

	// Condition reason for OutOfSync, e.g. errors when creating a reconciler.
	ReasonUnknown = "Unknown"
)
View Source
const (
	Anchors        = "subnamespaceanchors"
	SubnamespaceOf = MetaGroup + "/subnamespace-of"
)

Constants for the subnamespace anchor resource type and namespace annotation.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "hnc.x-k8s.io", Version: "v1alpha2"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = &scheme.Builder{GroupVersion: GroupVersion}

	// AddToScheme adds the types in this group-version to the given scheme.
	AddToScheme = SchemeBuilder.AddToScheme

	HNCConfigurationGR       = schema.GroupResource{Group: GroupVersion.Group, Resource: "hncconfigurations"}
	HierarchyConfigurationGR = schema.GroupResource{Group: GroupVersion.Group, Resource: "hierarchyconfigurations"}
	SubnamespaceAnchorGR     = schema.GroupResource{Group: GroupVersion.Group, Resource: "subnamespaceanchors"}
	HNCConfigurationGK       = schema.GroupKind{Group: GroupVersion.Group, Kind: "HNCConfiguration"}
	HierarchyConfigurationGK = schema.GroupKind{Group: GroupVersion.Group, Kind: "HierarchyConfiguration"}
	SubnamespaceAnchorGK     = schema.GroupKind{Group: GroupVersion.Group, Kind: "SubnamespaceAnchor"}
)

AllConditions have all the conditions by type and reason. Please keep this list in alphabetic order. This is specifically used to clear (set to 0) conditions in the metrics.

View Source
var EnforcedTypes = []ResourceSpec{
	{Group: RBACGroup, Resource: RoleResource, Mode: Propagate},
	{Group: RBACGroup, Resource: RoleBindingResource, Mode: Propagate},
}

EnforcedTypes are the types enforced by HNC that they should not show up in the spec and only in the status. Any configurations of the enforced types in the spec would cause 'MultipleConfigurationsForType' condition.

Functions

func IsEnforcedType

func IsEnforcedType(grm ResourceSpec) bool

IsEnforcedType returns true if configuration is on an enforced type.

Types

type HNCConfiguration

type HNCConfiguration struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   HNCConfigurationSpec   `json:"spec,omitempty"`
	Status HNCConfigurationStatus `json:"status,omitempty"`
}

HNCConfiguration is a cluster-wide configuration for HNC as a whole. See details in http://bit.ly/hnc-type-configuration

func (*HNCConfiguration) DeepCopy

func (in *HNCConfiguration) DeepCopy() *HNCConfiguration

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HNCConfiguration.

func (*HNCConfiguration) DeepCopyInto

func (in *HNCConfiguration) DeepCopyInto(out *HNCConfiguration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HNCConfiguration) DeepCopyObject

func (in *HNCConfiguration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HNCConfigurationList

type HNCConfigurationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []HNCConfiguration `json:"items"`
}

HNCConfigurationList contains a list of HNCConfiguration.

func (*HNCConfigurationList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HNCConfigurationList.

func (*HNCConfigurationList) DeepCopyInto

func (in *HNCConfigurationList) DeepCopyInto(out *HNCConfigurationList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HNCConfigurationList) DeepCopyObject

func (in *HNCConfigurationList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HNCConfigurationSpec

type HNCConfigurationSpec struct {
	// Resources defines the cluster-wide settings for resource synchronization.
	// Note that 'roles' and 'rolebindings' are pre-configured by HNC with
	// 'Propagate' mode and are omitted in the spec. Any configuration of 'roles'
	// or 'rolebindings' are not allowed. To learn more, see
	// https://github.com/kubernetes-sigs/hierarchical-namespaces/blob/master/docs/user-guide/how-to.md#admin-types
	Resources []ResourceSpec `json:"resources,omitempty"`
}

HNCConfigurationSpec defines the desired state of HNC configuration.

func (*HNCConfigurationSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HNCConfigurationSpec.

func (*HNCConfigurationSpec) DeepCopyInto

func (in *HNCConfigurationSpec) DeepCopyInto(out *HNCConfigurationSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HNCConfigurationStatus

type HNCConfigurationStatus struct {
	// Resources indicates the observed synchronization states of the resources.
	Resources []ResourceStatus `json:"resources,omitempty"`

	// Conditions describes the errors, if any. If there are any conditions with
	// "ActivitiesHalted" reason, this means that HNC cannot function in the
	// affected namespaces. The HierarchyConfiguration object in each of the
	// affected namespaces will have more information. To learn more about
	// conditions, see https://github.com/kubernetes-sigs/hierarchical-namespaces/blob/master/docs/user-guide/concepts.md#admin-conditions.
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

HNCConfigurationStatus defines the observed state of HNC configuration.

func (*HNCConfigurationStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HNCConfigurationStatus.

func (*HNCConfigurationStatus) DeepCopyInto

func (in *HNCConfigurationStatus) DeepCopyInto(out *HNCConfigurationStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HierarchicalResourceQuota added in v1.1.0

type HierarchicalResourceQuota struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// Spec defines the desired quota
	Spec HierarchicalResourceQuotaSpec `json:"spec,omitempty"`
	// Status defines the actual enforced quota and its current usage
	Status HierarchicalResourceQuotaStatus `json:"status,omitempty"`
}

HierarchicalResourceQuota sets aggregate quota restrictions enforced for a namespace and descendant namespaces

func (*HierarchicalResourceQuota) DeepCopy added in v1.1.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HierarchicalResourceQuota.

func (*HierarchicalResourceQuota) DeepCopyInto added in v1.1.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HierarchicalResourceQuota) DeepCopyObject added in v1.1.0

func (in *HierarchicalResourceQuota) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HierarchicalResourceQuotaList added in v1.1.0

type HierarchicalResourceQuotaList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []HierarchicalResourceQuota `json:"items"`
}

HierarchicalResourceQuotaList contains a list of HierarchicalResourceQuota

func (*HierarchicalResourceQuotaList) DeepCopy added in v1.1.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HierarchicalResourceQuotaList.

func (*HierarchicalResourceQuotaList) DeepCopyInto added in v1.1.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HierarchicalResourceQuotaList) DeepCopyObject added in v1.1.0

func (in *HierarchicalResourceQuotaList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HierarchicalResourceQuotaSpec added in v1.1.0

type HierarchicalResourceQuotaSpec struct {
	// Hard is the set of desired hard limits for each named resource
	// +optional
	Hard corev1.ResourceList `json:"hard,omitempty"`
}

HierarchicalResourceQuotaSpec defines the desired hard limits to enforce for a namespace and descendant namespaces

func (*HierarchicalResourceQuotaSpec) DeepCopy added in v1.1.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HierarchicalResourceQuotaSpec.

func (*HierarchicalResourceQuotaSpec) DeepCopyInto added in v1.1.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HierarchicalResourceQuotaStatus added in v1.1.0

type HierarchicalResourceQuotaStatus struct {
	// Hard is the set of enforced hard limits for each named resource
	// +optional
	Hard corev1.ResourceList `json:"hard,omitempty"`
	// Used is the current observed total usage of the resource in the namespace
	// and its descendant namespaces.
	// +optional
	Used corev1.ResourceList `json:"used,omitempty"`
}

HierarchicalResourceQuotaStatus defines the enforced hard limits and observed use for a namespace and descendant namespaces

func (*HierarchicalResourceQuotaStatus) DeepCopy added in v1.1.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HierarchicalResourceQuotaStatus.

func (*HierarchicalResourceQuotaStatus) DeepCopyInto added in v1.1.0

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HierarchyConfiguration

type HierarchyConfiguration struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   HierarchyConfigurationSpec   `json:"spec,omitempty"`
	Status HierarchyConfigurationStatus `json:"status,omitempty"`
}

Hierarchy is the Schema for the hierarchies API

func (*HierarchyConfiguration) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HierarchyConfiguration.

func (*HierarchyConfiguration) DeepCopyInto

func (in *HierarchyConfiguration) DeepCopyInto(out *HierarchyConfiguration)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HierarchyConfiguration) DeepCopyObject

func (in *HierarchyConfiguration) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HierarchyConfigurationList

type HierarchyConfigurationList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []HierarchyConfiguration `json:"items"`
}

HierarchyList contains a list of Hierarchy

func (*HierarchyConfigurationList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HierarchyConfigurationList.

func (*HierarchyConfigurationList) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*HierarchyConfigurationList) DeepCopyObject

func (in *HierarchyConfigurationList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type HierarchyConfigurationSpec

type HierarchyConfigurationSpec struct {

	// Parent indicates the parent of this namespace, if any.
	Parent string `json:"parent,omitempty"`

	// AllowCascadingDeletion indicates if the subnamespaces of this namespace are
	// allowed to cascading delete.
	AllowCascadingDeletion bool `json:"allowCascadingDeletion,omitempty"`

	// Lables is a list of labels and values to apply to the current namespace and all of its
	// descendants. All label keys must match a regex specified on the command line by
	// --managed-namespace-label. A namespace cannot have a KVP that conflicts with one of its
	// ancestors.
	Labels []MetaKVP `json:"labels,omitempty"`

	// Annotations is a list of annotations and values to apply to the current namespace and all of
	// its descendants. All annotation keys must match a regex specified on the command line by
	// --managed-namespace-annotation. A namespace cannot have a KVP that conflicts with one of its
	// ancestors.
	Annotations []MetaKVP `json:"annotations,omitempty"`
}

HierarchySpec defines the desired state of Hierarchy

func (*HierarchyConfigurationSpec) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HierarchyConfigurationSpec.

func (*HierarchyConfigurationSpec) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HierarchyConfigurationStatus

type HierarchyConfigurationStatus struct {

	// Children indicates the direct children of this namespace, if any.
	Children []string `json:"children,omitempty"`

	// Conditions describes the errors, if any.
	Conditions []metav1.Condition `json:"conditions,omitempty"`
}

HierarchyStatus defines the observed state of Hierarchy

func (*HierarchyConfigurationStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HierarchyConfigurationStatus.

func (*HierarchyConfigurationStatus) DeepCopyInto

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MetaKVP added in v1.0.0

type MetaKVP struct {
	// Key is the name of the label or annotation. It must conform to the normal rules for Kubernetes
	// label/annotation keys.
	Key string `json:"key"`

	// Value is the value of the label or annotation. It must confirm to the normal rules for
	// Kubernetes label or annoation values, which are far more restrictive for labels than for
	// anntations.
	Value string `json:"value"`
}

MetaKVP represents a label or annotation

func (*MetaKVP) DeepCopy added in v1.0.0

func (in *MetaKVP) DeepCopy() *MetaKVP

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MetaKVP.

func (*MetaKVP) DeepCopyInto added in v1.0.0

func (in *MetaKVP) DeepCopyInto(out *MetaKVP)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceSpec

type ResourceSpec struct {
	// Group of the resource defined below. This is used to unambiguously identify
	// the resource. It may be omitted for core resources (e.g. "secrets").
	Group string `json:"group,omitempty"`
	// Resource to be configured.
	Resource string `json:"resource"`
	// Synchronization mode of the kind. If the field is empty, it will be treated
	// as "Propagate".
	// +optional
	// +kubebuilder:validation:Enum=Propagate;Ignore;Remove;AllowPropagate
	Mode SynchronizationMode `json:"mode,omitempty"`
}

ResourceSpec defines the desired synchronization state of a specific resource.

func (*ResourceSpec) DeepCopy

func (in *ResourceSpec) DeepCopy() *ResourceSpec

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceSpec.

func (*ResourceSpec) DeepCopyInto

func (in *ResourceSpec) DeepCopyInto(out *ResourceSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ResourceStatus

type ResourceStatus struct {
	// The API group of the resource being synchronized.
	Group string `json:"group"`

	// The API version used by HNC when propagating this resource.
	Version string `json:"version"`

	// The resource being synchronized.
	Resource string `json:"resource"`

	// Mode describes the synchronization mode of the kind. Typically, it will be the same as the mode
	// in the spec, except when the reconciler has fallen behind or for resources with an enforced
	// default synchronization mode, such as RBAC objects.
	Mode SynchronizationMode `json:"mode,omitempty"`

	// Tracks the number of objects that are being propagated to descendant namespaces. The propagated
	// objects are created by HNC.
	// +kubebuilder:validation:Minimum=0
	// +optional
	NumPropagatedObjects *int `json:"numPropagatedObjects,omitempty"`

	// Tracks the number of objects that are created by users.
	// +kubebuilder:validation:Minimum=0
	// +optional
	NumSourceObjects *int `json:"numSourceObjects,omitempty"`
}

ResourceStatus defines the actual synchronization state of a specific resource.

func (*ResourceStatus) DeepCopy

func (in *ResourceStatus) DeepCopy() *ResourceStatus

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ResourceStatus.

func (*ResourceStatus) DeepCopyInto

func (in *ResourceStatus) DeepCopyInto(out *ResourceStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SubnamespaceAnchor

type SubnamespaceAnchor struct {
	metav1.TypeMeta   `json:",inline"`
	metav1.ObjectMeta `json:"metadata,omitempty"`

	Spec   SubnamespaceAnchorSpec   `json:"spec,omitempty"`
	Status SubnamespaceAnchorStatus `json:"status,omitempty"`
}

SubnamespaceAnchor is the Schema for the subnamespace API. See details at http://bit.ly/hnc-self-serve-ux.

func (*SubnamespaceAnchor) DeepCopy

func (in *SubnamespaceAnchor) DeepCopy() *SubnamespaceAnchor

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnamespaceAnchor.

func (*SubnamespaceAnchor) DeepCopyInto

func (in *SubnamespaceAnchor) DeepCopyInto(out *SubnamespaceAnchor)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SubnamespaceAnchor) DeepCopyObject

func (in *SubnamespaceAnchor) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SubnamespaceAnchorList

type SubnamespaceAnchorList struct {
	metav1.TypeMeta `json:",inline"`
	metav1.ListMeta `json:"metadata,omitempty"`
	Items           []SubnamespaceAnchor `json:"items"`
}

SubnamespaceAnchorList contains a list of SubnamespaceAnchor.

func (*SubnamespaceAnchorList) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnamespaceAnchorList.

func (*SubnamespaceAnchorList) DeepCopyInto

func (in *SubnamespaceAnchorList) DeepCopyInto(out *SubnamespaceAnchorList)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*SubnamespaceAnchorList) DeepCopyObject

func (in *SubnamespaceAnchorList) DeepCopyObject() runtime.Object

DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.

type SubnamespaceAnchorSpec added in v1.0.0

type SubnamespaceAnchorSpec struct {
	// Labels is a list of labels and values to apply to the current subnamespace and all of its
	// descendants. All label keys must match a regex specified on the command line by
	// --managed-namespace-label.
	// All label keys must be managed labels (see HNC docs) and must match a regex
	Labels []MetaKVP `json:"labels,omitempty"`

	// Annotations is a list of annotations and values to apply to the current subnamespace and all of
	// its descendants. All annotation keys must match a regex specified on the command line by
	// --managed-namespace-annotation.
	// All annotation keys must be managed annotations (see HNC docs) and must match a regex
	Annotations []MetaKVP `json:"annotations,omitempty"`
}

func (*SubnamespaceAnchorSpec) DeepCopy added in v1.0.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnamespaceAnchorSpec.

func (*SubnamespaceAnchorSpec) DeepCopyInto added in v1.0.0

func (in *SubnamespaceAnchorSpec) DeepCopyInto(out *SubnamespaceAnchorSpec)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SubnamespaceAnchorState

type SubnamespaceAnchorState string

SubnamespaceAnchorState describes the state of the subnamespace. The state could be "Missing", "Ok", "Conflict" or "Forbidden". The definitions will be described below.

const (
	Missing   SubnamespaceAnchorState = "Missing"
	Ok        SubnamespaceAnchorState = "Ok"
	Conflict  SubnamespaceAnchorState = "Conflict"
	Forbidden SubnamespaceAnchorState = "Forbidden"
)

Anchor states, which are documented in the comment to SubnamespaceAnchorStatus.State.

type SubnamespaceAnchorStatus

type SubnamespaceAnchorStatus struct {
	// Describes the state of the subnamespace anchor.
	//
	// Currently, the supported values are:
	//
	// - "Missing": the subnamespace has not been created yet. This should be the default state when
	// the anchor is just created.
	//
	// - "Ok": the subnamespace exists. This is the only good state of the anchor.
	//
	// - "Conflict": a namespace of the same name already exists. The admission controller will
	// attempt to prevent this.
	//
	// - "Forbidden": the anchor was created in a namespace that doesn't allow children, such as
	// kube-system or hnc-system. The admission controller will attempt to prevent this.
	State SubnamespaceAnchorState `json:"status,omitempty"`
}

SubnamespaceAnchorStatus defines the observed state of SubnamespaceAnchor.

func (*SubnamespaceAnchorStatus) DeepCopy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubnamespaceAnchorStatus.

func (*SubnamespaceAnchorStatus) DeepCopyInto

func (in *SubnamespaceAnchorStatus) DeepCopyInto(out *SubnamespaceAnchorStatus)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type SynchronizationMode

type SynchronizationMode string

SynchronizationMode describes propagation mode of objects of the same kind. The only four modes currently supported are "Propagate", "AllowPropagate", "Ignore", and "Remove". See detailed definition below. An unsupported mode will be treated as "ignore".

const (
	// Propagate objects from ancestors to descendants and deletes obsolete descendants.
	Propagate SynchronizationMode = "Propagate"

	// Ignore the modification of this resource. New or changed objects will not be propagated, and
	// obsolete objects will not be deleted. The inheritedFrom label is not removed.  Any unknown mode
	// is treated as Ignore.
	Ignore SynchronizationMode = "Ignore"

	// Remove all existing propagated copies.
	Remove SynchronizationMode = "Remove"

	// AllowPropagate allows propagation of objects from ancestors to descendants
	// and deletes obsolete descendants only if a an annotation is set on the object
	AllowPropagate SynchronizationMode = "AllowPropagate"
)

Jump to

Keyboard shortcuts

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