v1

package
v1.18.1 Latest Latest
Warning

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

Go to latest
Published: May 16, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package v1 contains the version 1 data definition for the ConfigManagement custom resources.

To regenerate clientset and deepcopy run:

make clientgen

DO NOT MOVE THESE OUT OF THE PACKAGE DOCSTRING, GENERATING CODE PROPERLY DEPENDS ON THEM BEING HERE. +kubebuilder:object:generate=true +groupName=configmanagement.gke.io

Index

Constants

View Source
const (
	// StateUnknown indicates that the config's state is undeclared or unknown.
	StateUnknown = ConfigSyncState("")

	// StateSynced indicates that the config is the same as the last known version from the source of
	// truth.
	StateSynced = ConfigSyncState("synced")

	// StateStale indicates that the config is different than the last known version from the source
	// of truth.
	StateStale = ConfigSyncState("stale")

	// StateError indicates that there was an error updating the config to match the last known
	// version from the source of truth.
	StateError = ConfigSyncState("error")
)
View Source
const (
	// ResourceStateHealthy indicates a resource with no sync errors found
	ResourceStateHealthy = ResourceConditionState("Healthy")

	// ResourceStateReconciling indicates that a resource is currently being reconciled by a controller
	ResourceStateReconciling = ResourceConditionState("Reconciling")

	// ResourceStateError indicates that an error has occurred while reconciling a resource
	ResourceStateError = ResourceConditionState("Error")
)
View Source
const (
	// HierarchyModeInherit indicates that the resource can appear in abstract namespace directories
	// and will be inherited by any descendent namespaces. Without this value on the Sync, resources
	// must not appear in abstract namespaces.
	HierarchyModeInherit = HierarchyModeType("inherit")
	// HierarchyModeNone indicates that the resource cannot appear in abstract namespace directories.
	// For most resource types, this is the same as default, and it's not necessary to specify this
	// value. But RoleBinding and ResourceQuota have different default behaviors, and this value is
	// used to disable inheritance behaviors for those types.
	HierarchyModeNone = HierarchyModeType("none")
	// HierarchyModeDefault is the default value. Default behavior is type-specific.
	HierarchyModeDefault = HierarchyModeType("")
)
View Source
const (
	// EventReasonReconcileComplete reports that reconcile succeeded.
	EventReasonReconcileComplete = "ReconcileComplete"
	// EventReasonCRDChange reports that the set of CRDs available on the cluster
	// changed.
	EventReasonCRDChange = "CRDChange"
	// EventReasonStatusUpdateFailed reports that the Syncer was unable to update
	// the status fields of ACM resources.
	EventReasonStatusUpdateFailed = "StatusUpdateFailed"
	// EventReasonInvalidAnnotation reports that there was an issue syncing due to
	// an invalid annotation on a resource.
	EventReasonInvalidAnnotation = "InvalidAnnotation"
	// EventReasonInvalidClusterConfig reports that there is a ClusterConfig on
	// the cluster with an unrecognized name.
	EventReasonInvalidClusterConfig = "InvalidClusterConfig"
	// EventReasonInvalidManagementAnnotation reports that syncing a specific Namespace
	// failed due to it having an invalid management annotation.
	//
	// TODO: Should the reason be "InvalidManagementAnnotation"?
	EventReasonInvalidManagementAnnotation = "InvalidManagementLabel"
	// EventReasonNamespaceCreateFailed reports the syncer was unable to sync
	// a Namespace and its resources due to being unable to create the Namespace.
	EventReasonNamespaceCreateFailed = "NamespaceCreateFailed"
	// EventReasonNamespaceUpdateFailed reports that the syncer was unable to
	// update the resources in a specific Namespace.
	EventReasonNamespaceUpdateFailed = "NamespaceUpdateFailed"
)

ACM-specific reasons for recorded Kubernetes Events.

View Source
const (
	// NSSelectorStaticMode indicates the NamespaceSelector uses `static` mode.
	NSSelectorStaticMode string = "static"
	// NSSelectorDynamicMode indicates the NamespaceSelector uses `dynamic` mode.
	NSSelectorDynamicMode string = "dynamic"
)
View Source
const CRDClusterConfigName = "config-management-crd-cluster-config"

CRDClusterConfigName is the name of the ClusterConfig for CRD resources.

View Source
const ClusterConfigName = "config-management-cluster-config"

ClusterConfigName is the name of the ClusterConfig for all non-CRD cluster resources.

View Source
const SyncFinalizer = "syncer." + configmanagement.GroupName

SyncFinalizer is a finalizer handled by Syncer to ensure Sync deletions complete before Importer writes ClusterConfig and NamespaceConfig resources.

Variables

View Source
var (
	// SchemeBuilder is the scheme builder for types in this package
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)
	// AddToScheme adds the types in this package ot a scheme.
	AddToScheme = SchemeBuilder.AddToScheme
)
View Source
var SchemeGroupVersion = schema.GroupVersion{Group: configmanagement.GroupName, Version: "v1"}

SchemeGroupVersion is group version used to register these objects

Functions

func Resource

func Resource(resource string) schema.GroupResource

Resource takes an unqualified resource and returns a Group qualified GroupResource

Types

type ClusterConfig

type ClusterConfig struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// The actual object definition, per K8S object definition style.
	// +optional
	Spec ClusterConfigSpec `json:"spec,omitempty"`

	// The current status of the object, per K8S object definition style.
	// +optional
	Status ClusterConfigStatus `json:"status,omitempty"`
}

ClusterConfig is the top-level object for the config data definition.

It holds a config defined for a single org unit (namespace).

func NewCRDClusterConfig

func NewCRDClusterConfig(importToken string, loadTime metav1.Time) *ClusterConfig

NewCRDClusterConfig initializes a CRD Clusterconfig.

func NewClusterConfig

func NewClusterConfig(importToken string, loadTime metav1.Time) *ClusterConfig

NewClusterConfig initializes a ClusterConfig.

func (*ClusterConfig) AddResource

func (c *ClusterConfig) AddResource(o client.Object)

AddResource adds a client.Object to this ClusterConfig.

func (*ClusterConfig) DeepCopy

func (in *ClusterConfig) DeepCopy() *ClusterConfig

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

func (*ClusterConfig) DeepCopyInto

func (in *ClusterConfig) DeepCopyInto(out *ClusterConfig)

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

func (*ClusterConfig) DeepCopyObject

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

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

type ClusterConfigList

type ClusterConfigList struct {
	metav1.TypeMeta `json:",inline"`
	// Standard object's metadata.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of configs that apply.
	Items []ClusterConfig `json:"items"`
}

ClusterConfigList holds a list of cluster level configs, returned as response to a List call on the cluster config hierarchy.

func (*ClusterConfigList) DeepCopy

func (in *ClusterConfigList) DeepCopy() *ClusterConfigList

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

func (*ClusterConfigList) DeepCopyInto

func (in *ClusterConfigList) DeepCopyInto(out *ClusterConfigList)

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

func (*ClusterConfigList) DeepCopyObject

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

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

type ClusterConfigSpec

type ClusterConfigSpec struct {
	// Token indicates the version of the ClusterConfig last imported from the source of truth.
	// +optional
	Token string `json:"token,omitempty"`

	// ImportTime is the timestamp of when the ClusterConfig was updated by the Importer.
	// +optional
	ImportTime metav1.Time `json:"importTime,omitempty"`

	// Resources contains namespace scoped resources that are synced to the API server.
	// +optional
	Resources []GenericResources `json:"resources,omitempty"`
}

ClusterConfigSpec defines the configs that will exist at the cluster level.

func (*ClusterConfigSpec) DeepCopy

func (in *ClusterConfigSpec) DeepCopy() *ClusterConfigSpec

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

func (*ClusterConfigSpec) DeepCopyInto

func (in *ClusterConfigSpec) DeepCopyInto(out *ClusterConfigSpec)

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

type ClusterConfigStatus

type ClusterConfigStatus struct {
	// Token indicates the version of the config that the Syncer last attempted to update from.
	// +optional
	Token string `json:"token,omitempty"`

	// SyncErrors contains any errors that occurred during the last attempt the Syncer made to update
	// resources from the ClusterConfig specs. This field will be empty on success.
	// +optional
	SyncErrors []ConfigManagementError `json:"syncErrors,omitempty"`

	// SyncTime is the timestamp of when the config resources were last updated by the Syncer.
	// +optional
	SyncTime metav1.Time `json:"syncTime,omitempty"`

	// SyncState is the current state of the config resources (eg synced, stale, error).
	// +optional
	SyncState ConfigSyncState `json:"syncState,omitempty"`

	// ResourceConditions contains health status of cluster-scope resources
	// +optional
	ResourceConditions []ResourceCondition `json:"resourceConditions,omitempty"`
}

ClusterConfigStatus contains fields that define the status of a ClusterConfig.

func (*ClusterConfigStatus) DeepCopy

func (in *ClusterConfigStatus) DeepCopy() *ClusterConfigStatus

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

func (*ClusterConfigStatus) DeepCopyInto

func (in *ClusterConfigStatus) DeepCopyInto(out *ClusterConfigStatus)

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

type ClusterSelector

type ClusterSelector struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ObjectMeta `json:"metadata"`

	// The actual object definition, per K8S object definition style.
	Spec ClusterSelectorSpec `json:"spec"`
}

ClusterSelector specifies a LabelSelector applied to clusters that exist within a cluster registry.

func (*ClusterSelector) DeepCopy

func (in *ClusterSelector) DeepCopy() *ClusterSelector

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

func (*ClusterSelector) DeepCopyInto

func (in *ClusterSelector) DeepCopyInto(out *ClusterSelector)

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

func (*ClusterSelector) DeepCopyObject

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

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

type ClusterSelectorList

type ClusterSelectorList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of selectors.
	Items []ClusterSelector `json:"items"`
}

ClusterSelectorList holds a list of ClusterSelector resources.

func (*ClusterSelectorList) DeepCopy

func (in *ClusterSelectorList) DeepCopy() *ClusterSelectorList

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

func (*ClusterSelectorList) DeepCopyInto

func (in *ClusterSelectorList) DeepCopyInto(out *ClusterSelectorList)

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

func (*ClusterSelectorList) DeepCopyObject

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

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

type ClusterSelectorSpec

type ClusterSelectorSpec struct {
	// Selects clusters.
	// This field is NOT optional and follows standard label selector semantics. An empty selector
	// matches all clusters.
	Selector metav1.LabelSelector `json:"selector"`
}

ClusterSelectorSpec contains spec fields for ClusterSelector.

func (*ClusterSelectorSpec) DeepCopy

func (in *ClusterSelectorSpec) DeepCopy() *ClusterSelectorSpec

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

func (*ClusterSelectorSpec) DeepCopyInto

func (in *ClusterSelectorSpec) DeepCopyInto(out *ClusterSelectorSpec)

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

type ConfigManagementError

type ConfigManagementError struct {
	// ErrorResource is unused and should be removed when we uprev the API version.
	ErrorResource `json:",inline"`

	// Code is the error code of this particular error.  Error codes are numeric strings,
	// like "1012".
	// +optional
	Code string `json:"code"`

	// ErrorMessage describes the error that occurred.
	// +optional
	ErrorMessage string `json:"errorMessage,omitempty"`

	// ErrorResourcs describes the resources associated with this error, if any.
	ErrorResources []ErrorResource `json:"errorResources,omitempty"`
}

ConfigManagementError represents an error that occurs during the management of configs. It is typically produced when processing the source of truth, importing a config, or syncing a K8S resource.

func (*ConfigManagementError) DeepCopy

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

func (*ConfigManagementError) DeepCopyInto

func (in *ConfigManagementError) DeepCopyInto(out *ConfigManagementError)

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

type ConfigSyncState

type ConfigSyncState string

ConfigSyncState represents the states that a NamespaceConfig or ClusterConfig can be in with regards to the source of truth.

func (ConfigSyncState) IsSynced

func (p ConfigSyncState) IsSynced() bool

IsSynced returns true if the state indicates a config that is synced to the source of truth.

func (ConfigSyncState) IsUnknown

func (p ConfigSyncState) IsUnknown() bool

IsUnknown returns true if the state is unknown or undeclared.

type ErrorResource

type ErrorResource struct {
	// SourcePath is the repo-relative slash path to where the config is defined. This field may be
	// empty for errors that are not associated with a specific config file.
	// +optional
	SourcePath string `json:"sourcePath,omitempty"`

	// ResourceName is the name of the affected K8S resource. This field may be empty for errors that
	// are not associated with a specific resource.
	// +optional
	ResourceName string `json:"resourceName,omitempty"`

	// ResourceNamespace is the namespace of the affected K8S resource. This field may be empty for
	// errors that are associated with a cluster-scoped resource or not associated with a specific
	// resource.
	// +optional
	ResourceNamespace string `json:"resourceNamespace,omitempty"`

	// ResourceGVK is the GroupVersionKind of the affected K8S resource. This field may be empty for
	// errors that are not associated with a specific resource.
	// +optional
	ResourceGVK GroupVersionKind `json:"resourceGVK"`
}

ErrorResource contains the identification bits of a single resource that is involved in a resource error.

func (*ErrorResource) DeepCopy

func (in *ErrorResource) DeepCopy() *ErrorResource

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

func (*ErrorResource) DeepCopyInto

func (in *ErrorResource) DeepCopyInto(out *ErrorResource)

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

type GenericResources

type GenericResources struct {
	// Group is the Group for all resources contained within
	// +optional
	Group string `json:"group,omitempty"`

	// Kind is the Kind for all resources contained within.
	Kind string `json:"kind"`

	// Versions is a list Versions corresponding to the Version for this Group and Kind.
	Versions []GenericVersionResources `json:"versions"` // Per version information.
}

GenericResources contains API objects of a specified Group and Kind.

func (*GenericResources) DeepCopy

func (in *GenericResources) DeepCopy() *GenericResources

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

func (*GenericResources) DeepCopyInto

func (in *GenericResources) DeepCopyInto(out *GenericResources)

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

type GenericVersionResources

type GenericVersionResources struct {
	// Version is the version of all objects in Objects.
	Version string `json:"version"`

	// Objects is the list of objects of a single Group Version and Kind.
	Objects []runtime.RawExtension `json:"objects"`
}

GenericVersionResources holds a set of resources of a single version for a Group and Kind.

func (*GenericVersionResources) DeepCopy

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

func (*GenericVersionResources) DeepCopyInto

func (in *GenericVersionResources) DeepCopyInto(out *GenericVersionResources)

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

type Git

type Git struct {
	// Repo is the git repository URL to sync from. Required.
	Repo string `json:"repo"`

	// Branch is the git branch to checkout. Default: "master".
	// +optional
	Branch string `json:"branch,omitempty"`

	// Revision is the git revision (tag, ref or commit) to fetch.
	// +optional
	Revision string `json:"revision,omitempty"`

	// Dir is the absolute path of the directory that contains
	// the local policy.  Default: the root directory of the repo.
	// +optional
	Dir string `json:"dir,omitempty"`

	// Period is the time duration between consecutive syncs. Default: 15s.
	// Note to developers that customers specify this value using
	// string (https://golang.org/pkg/time/#Duration.String) like "3s"
	// in their Custom Resource YAML. However, time.Duration is at a nanosecond
	// granularity, and it's easy to introduce a bug where it looks like the
	// code is dealing with seconds but its actually nanoseconds (or vice versa).
	// +optional
	Period metav1.Duration `json:"period,omitempty"`

	// Auth is the type of secret configured for access to the Git repo.
	// Must be one of ssh, cookiefile, gcenode, token, or none. Required.
	// The validation of this is case-sensitive. Required.
	//
	// +kubebuilder:validation:Pattern=^(ssh|cookiefile|gcenode|token|none)$
	Auth string `json:"auth"`

	// Proxy is a struct that contains options for configuring access to the Git repo via a proxy.
	// Only has an effect when secretType is one of ("cookiefile", "none"). Optional.
	// +optional
	Proxy string `json:"proxy,omitempty"`

	// SecretRef is the secret used to connect to the Git source of truth.
	// +optional
	SecretRef SecretReference `json:"secretRef,omitempty"`
}

Git contains the configs needed by GitPolicyImporter.

func (*Git) DeepCopy

func (in *Git) DeepCopy() *Git

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

func (*Git) DeepCopyInto

func (in *Git) DeepCopyInto(out *Git)

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

type GroupVersionKind added in v1.17.0

type GroupVersionKind struct {
	Group   string `json:"group"`
	Version string `json:"version"`
	Kind    string `json:"kind"`
}

GroupVersionKind identifies a Kind. It substitutes schema.GroupVersionKind with json tags.

func ParseSchemaGVK added in v1.17.0

func ParseSchemaGVK(gvk schema.GroupVersionKind) GroupVersionKind

ParseSchemaGVK parses the schema.GroupVersionKind into custom groupVersionKind with json tags.

func (*GroupVersionKind) DeepCopy added in v1.17.0

func (in *GroupVersionKind) DeepCopy() *GroupVersionKind

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

func (*GroupVersionKind) DeepCopyInto added in v1.17.0

func (in *GroupVersionKind) DeepCopyInto(out *GroupVersionKind)

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

type HierarchyConfig

type HierarchyConfig struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata. The Name field of the config must match the namespace name.
	// +optional
	metav1.ObjectMeta `json:"metadata"`

	// Spec is the standard spec field.
	Spec HierarchyConfigSpec `json:"spec"`
}

HierarchyConfig is used for configuring the HierarchyModeType for managed resources.

func (*HierarchyConfig) DeepCopy

func (in *HierarchyConfig) DeepCopy() *HierarchyConfig

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

func (*HierarchyConfig) DeepCopyInto

func (in *HierarchyConfig) DeepCopyInto(out *HierarchyConfig)

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

func (*HierarchyConfig) DeepCopyObject

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

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

type HierarchyConfigList

type HierarchyConfigList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of HierarchyConfigs.
	Items []HierarchyConfig `json:"items"`
}

HierarchyConfigList holds a list of HierarchyConfig resources.

func (*HierarchyConfigList) DeepCopy

func (in *HierarchyConfigList) DeepCopy() *HierarchyConfigList

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

func (*HierarchyConfigList) DeepCopyInto

func (in *HierarchyConfigList) DeepCopyInto(out *HierarchyConfigList)

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

func (*HierarchyConfigList) DeepCopyObject

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

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

type HierarchyConfigResource

type HierarchyConfigResource struct {
	// Group is the name of the APIGroup that contains the resources.
	// +optional
	Group string `json:"group,omitempty"`
	// Kinds is a list of kinds this rule applies to.
	// +optional
	Kinds []string `json:"kinds,omitempty"`
	// HierarchyMode specifies how the object is treated when it appears in an abstract namespace.
	// The default is "inherit", meaning objects are inherited from parent abstract namespaces.
	// If set to "none", the type is not allowed in Abstract Namespaces.
	// +optional
	HierarchyMode HierarchyModeType `json:"hierarchyMode,omitempty"`
}

HierarchyConfigResource specifies the HierarchyModeType based on the matching Groups and Kinds enabled.

func (*HierarchyConfigResource) DeepCopy

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

func (*HierarchyConfigResource) DeepCopyInto

func (in *HierarchyConfigResource) DeepCopyInto(out *HierarchyConfigResource)

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

type HierarchyConfigSpec

type HierarchyConfigSpec struct {
	Resources []HierarchyConfigResource `json:"resources"`
}

HierarchyConfigSpec specifies the HierarchyConfigResources.

func (*HierarchyConfigSpec) DeepCopy

func (in *HierarchyConfigSpec) DeepCopy() *HierarchyConfigSpec

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

func (*HierarchyConfigSpec) DeepCopyInto

func (in *HierarchyConfigSpec) DeepCopyInto(out *HierarchyConfigSpec)

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

type HierarchyModeType

type HierarchyModeType string

HierarchyModeType defines hierarchical behavior for namespaced objects.

type NamespaceConfig

type NamespaceConfig struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata. The Name field of the config must match the namespace name.
	// +optional
	metav1.ObjectMeta `json:"metadata"`

	// The actual object definition, per K8S object definition style.
	// +optional
	Spec NamespaceConfigSpec `json:"spec,omitempty"`

	// The current status of the object, per K8S object definition style.
	// +optional
	Status NamespaceConfigStatus `json:"status,omitempty"`
}

NamespaceConfig is the top-level object for the config data definition.

It holds a config defined for a single org unit (namespace).

func NewNamespaceConfig

func NewNamespaceConfig(
	name string,
	annotations map[string]string,
	labels map[string]string,
	importToken string,
	loadTime metav1.Time,
) *NamespaceConfig

NewNamespaceConfig initializes a Namespace cluster config.

func (*NamespaceConfig) AddResource

func (c *NamespaceConfig) AddResource(o client.Object)

AddResource adds a client.Object to this NamespaceConfig.

func (*NamespaceConfig) DeepCopy

func (in *NamespaceConfig) DeepCopy() *NamespaceConfig

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

func (*NamespaceConfig) DeepCopyInto

func (in *NamespaceConfig) DeepCopyInto(out *NamespaceConfig)

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

func (*NamespaceConfig) DeepCopyObject

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

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

type NamespaceConfigList

type NamespaceConfigList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of configs that apply.
	Items []NamespaceConfig `json:"items"`
}

NamespaceConfigList holds a list of NamespaceConfigs, as response to a List call on the config hierarchy API.

func (*NamespaceConfigList) DeepCopy

func (in *NamespaceConfigList) DeepCopy() *NamespaceConfigList

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

func (*NamespaceConfigList) DeepCopyInto

func (in *NamespaceConfigList) DeepCopyInto(out *NamespaceConfigList)

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

func (*NamespaceConfigList) DeepCopyObject

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

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

type NamespaceConfigSpec

type NamespaceConfigSpec struct {
	// Token indicates the version of the NamespaceConfig last imported from the source of truth.
	// +optional
	Token string `json:"token,omitempty"`

	// ImportTime is the timestamp of when the NamespaceConfig was updated by the Importer.
	// +optional
	ImportTime metav1.Time `json:"importTime,omitempty"`

	// Resources contains namespace scoped resources that are synced to the API server.
	// +optional
	Resources []GenericResources `json:"resources,omitempty"`

	// DeleteSyncedTime is the time at which the importer identified the intent to delete
	// the corresponding Namespace
	// +optional
	DeleteSyncedTime metav1.Time `json:"deleteSyncedTime,omitempty"`
}

NamespaceConfigSpec contains all the information about a config linkage.

func (*NamespaceConfigSpec) DeepCopy

func (in *NamespaceConfigSpec) DeepCopy() *NamespaceConfigSpec

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

func (*NamespaceConfigSpec) DeepCopyInto

func (in *NamespaceConfigSpec) DeepCopyInto(out *NamespaceConfigSpec)

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

type NamespaceConfigStatus

type NamespaceConfigStatus struct {
	// Token indicates the version of the config that the Syncer last attempted to update from.
	// +optional
	Token string `json:"token,omitempty"`

	// SyncErrors contains any errors that occurred during the last attempt the Syncer made to update
	// resources from the NamespaceConfig specs. This field will be empty on success.
	// +optional
	SyncErrors []ConfigManagementError `json:"syncErrors,omitempty"`

	// SyncTime is the timestamp of when the config resources were last updated by the Syncer.
	// +optional
	SyncTime metav1.Time `json:"syncTime,omitempty"`

	// SyncState is the current state of the config resources (eg synced, stale, error).
	// +optional
	SyncState ConfigSyncState `json:"syncState,omitempty"`

	// ResourceConditions contains health status of namespaced resources
	// +optional
	ResourceConditions []ResourceCondition `json:"resourceConditions,omitempty"`
}

NamespaceConfigStatus contains fields that define the status of a NamespaceConfig.

func (*NamespaceConfigStatus) DeepCopy

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

func (*NamespaceConfigStatus) DeepCopyInto

func (in *NamespaceConfigStatus) DeepCopyInto(out *NamespaceConfigStatus)

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

type NamespaceSelector

type NamespaceSelector struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata. The Name field of the config must match the namespace name.
	// +optional
	metav1.ObjectMeta `json:"metadata"`

	// The actual object definition, per K8S object definition style.
	Spec NamespaceSelectorSpec `json:"spec"`
}

NamespaceSelector specifies a LabelSelector applied to namespaces that exist within a NamespaceConfig hierarchy.

func (*NamespaceSelector) DeepCopy

func (in *NamespaceSelector) DeepCopy() *NamespaceSelector

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

func (*NamespaceSelector) DeepCopyInto

func (in *NamespaceSelector) DeepCopyInto(out *NamespaceSelector)

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

func (*NamespaceSelector) DeepCopyObject

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

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

type NamespaceSelectorList

type NamespaceSelectorList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of NamespaceSelectors.
	Items []NamespaceSelector `json:"items"`
}

NamespaceSelectorList holds a list of NamespaceSelector resources.

func (*NamespaceSelectorList) DeepCopy

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

func (*NamespaceSelectorList) DeepCopyInto

func (in *NamespaceSelectorList) DeepCopyInto(out *NamespaceSelectorList)

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

func (*NamespaceSelectorList) DeepCopyObject

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

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

type NamespaceSelectorSpec

type NamespaceSelectorSpec struct {
	// Selects namespaces.
	// This field is NOT optional and follows standard label selector semantics. An empty selector
	// matches all namespaces.
	Selector metav1.LabelSelector `json:"selector"`

	// mode specifies the selection mode of the NamespaceSelector.
	// It must be set to either "static" or "dynamic" and is optional. If not specified, it defaults to "static."
	// In static mode, only resources with labels matching Namespaces statically declared in the source of truth are selected.
	// In dynamic mode, selection includes both statically declared Namespaces and Namespaces present on the cluster.
	// +kubebuilder:validation:Pattern=^(static|dynamic)$
	// +kubebuilder:default:=static
	// +optional
	Mode string `json:"mode,omitempty"`
}

NamespaceSelectorSpec contains spec fields for NamespaceSelector.

func (*NamespaceSelectorSpec) DeepCopy

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

func (*NamespaceSelectorSpec) DeepCopyInto

func (in *NamespaceSelectorSpec) DeepCopyInto(out *NamespaceSelectorSpec)

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

type Repo

type Repo struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ObjectMeta `json:"metadata,omitempty"`

	// +optional
	Spec RepoSpec `json:"spec,omitempty"`

	// +optional
	Status RepoStatus `json:"status,omitempty"`
}

Repo holds configuration and status about the Nomos source of truth.

func (*Repo) DeepCopy

func (in *Repo) DeepCopy() *Repo

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

func (*Repo) DeepCopyInto

func (in *Repo) DeepCopyInto(out *Repo)

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

func (*Repo) DeepCopyObject

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

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

type RepoImportStatus

type RepoImportStatus struct {
	// Most recent version token imported from the source of truth into Nomos CRs. This token is
	// updated once the importer finishes processing a change, whether or not there were errors
	// during the import.
	// +optional
	Token string `json:"token,omitempty"`

	// LastUpdate is the timestamp of when this status was updated by the Importer.
	// +optional
	LastUpdate metav1.Time `json:"lastUpdate,omitempty"`

	// Errors is a list of any errors that occurred while performing the most recent import indicated
	// by Token.
	// +optional
	Errors []ConfigManagementError `json:"errors,omitempty"`
}

RepoImportStatus contains status fields for the import of the Repo.

func (*RepoImportStatus) DeepCopy

func (in *RepoImportStatus) DeepCopy() *RepoImportStatus

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

func (*RepoImportStatus) DeepCopyInto

func (in *RepoImportStatus) DeepCopyInto(out *RepoImportStatus)

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

type RepoList

type RepoList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of Repo declarations.
	Items []Repo `json:"items"`
}

RepoList holds a list of Repo resources.

func (*RepoList) DeepCopy

func (in *RepoList) DeepCopy() *RepoList

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

func (*RepoList) DeepCopyInto

func (in *RepoList) DeepCopyInto(out *RepoList)

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

func (*RepoList) DeepCopyObject

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

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

type RepoSourceStatus

type RepoSourceStatus struct {
	// Most recent version token seen in the source of truth (eg the repo). This token is updated as
	// soon as the config importer sees a new change in the repo.
	// +optional
	Token string `json:"token,omitempty"`

	// Errors is a list of any errors that occurred while reading from the source of truth.
	// +optional
	Errors []ConfigManagementError `json:"errors,omitempty"`
}

RepoSourceStatus contains status fields for the Repo's source of truth.

func (*RepoSourceStatus) DeepCopy

func (in *RepoSourceStatus) DeepCopy() *RepoSourceStatus

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

func (*RepoSourceStatus) DeepCopyInto

func (in *RepoSourceStatus) DeepCopyInto(out *RepoSourceStatus)

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

type RepoSpec

type RepoSpec struct {
	// Repo version string, corresponds to how the config importer should handle the directory
	// structure (implicit assumptions).
	Version string `json:"version"`
}

RepoSpec contains spec fields for Repo.

func (*RepoSpec) DeepCopy

func (in *RepoSpec) DeepCopy() *RepoSpec

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

func (*RepoSpec) DeepCopyInto

func (in *RepoSpec) DeepCopyInto(out *RepoSpec)

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

type RepoStatus

type RepoStatus struct {
	// +optional
	Source RepoSourceStatus `json:"source,omitempty"`

	// +optional
	Import RepoImportStatus `json:"import,omitempty"`

	// +optional
	Sync RepoSyncStatus `json:"sync,omitempty"`
}

RepoStatus contains status fields for Repo.

func (*RepoStatus) DeepCopy

func (in *RepoStatus) DeepCopy() *RepoStatus

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

func (*RepoStatus) DeepCopyInto

func (in *RepoStatus) DeepCopyInto(out *RepoStatus)

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

type RepoSyncChangeStatus

type RepoSyncChangeStatus struct {
	// Token is the version token for the change being synced from the source of truth to managed K8S
	// resources.
	// +optional
	Token string `json:"token,omitempty"`

	// Errors is a list of any errors that occurred while syncing the resources changed for the
	// version token above.
	// +optional
	Errors []ConfigManagementError `json:"errors,omitempty"`
}

RepoSyncChangeStatus represents the status of a single change being synced in the Repo.

func (*RepoSyncChangeStatus) DeepCopy

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

func (*RepoSyncChangeStatus) DeepCopyInto

func (in *RepoSyncChangeStatus) DeepCopyInto(out *RepoSyncChangeStatus)

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

type RepoSyncStatus

type RepoSyncStatus struct {
	// LatestToken is the most recent version token synced from the source of truth to managed K8S
	// resources. This token is updated as soon as the syncer starts processing a new change, whether
	// or not it has finished processing or if there were errors during the sync.
	// +optional
	LatestToken string `json:"latestToken,omitempty"`

	// LastUpdate is the timestamp of when this status was updated by the Importer.
	// +optional
	LastUpdate metav1.Time `json:"lastUpdate,omitempty"`

	// InProgress is a list of changes that are currently being synced. Each change may or may not
	// have associated errors.
	// +optional
	InProgress []RepoSyncChangeStatus `json:"inProgress,omitempty"`

	ResourceConditions []ResourceCondition `json:"resourceConditions,omitempty"`
}

RepoSyncStatus contains status fields for the sync of the Repo.

func (*RepoSyncStatus) DeepCopy

func (in *RepoSyncStatus) DeepCopy() *RepoSyncStatus

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

func (*RepoSyncStatus) DeepCopyInto

func (in *RepoSyncStatus) DeepCopyInto(out *RepoSyncStatus)

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

type ResourceCondition

type ResourceCondition struct {
	GroupVersion   string                 `json:"groupVersion,omitempty"`
	Kind           string                 `json:"kind,omitempty"`
	NamespacedName string                 `json:"namespacedName,omitempty"`
	ResourceState  ResourceConditionState `json:"resourceState,omitempty"`
	Token          string                 `json:"token,omitempty"`

	// These fields match the proposed conditions/annotations for status.
	ReconcilingReasons []string `json:"reconcilingReasons,omitempty"`
	Errors             []string `json:"errors,omitempty"`
}

ResourceCondition represents the sync status of the resource

func (*ResourceCondition) DeepCopy

func (in *ResourceCondition) DeepCopy() *ResourceCondition

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

func (*ResourceCondition) DeepCopyInto

func (in *ResourceCondition) DeepCopyInto(out *ResourceCondition)

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

type ResourceConditionState

type ResourceConditionState string

ResourceConditionState represents the states that a ResourceCondition can be in

func (ResourceConditionState) IsError

func (p ResourceConditionState) IsError() bool

IsError returns true if the state is in error.

func (ResourceConditionState) IsReconciling

func (p ResourceConditionState) IsReconciling() bool

IsReconciling returns true if the state is reconciling.

type SecretReference

type SecretReference struct {
	// Name represents the secret name.
	// +optional
	Name string `json:"name,omitempty"`
}

SecretReference contains the reference to the secret used to connect to Git source of truth.

func (*SecretReference) DeepCopy

func (in *SecretReference) DeepCopy() *SecretReference

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

func (*SecretReference) DeepCopyInto

func (in *SecretReference) DeepCopyInto(out *SecretReference)

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

type Sync

type Sync struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata. The Name field of the config must match the namespace name.
	// +optional
	metav1.ObjectMeta `json:"metadata"`

	// Spec is the standard spec field.
	Spec SyncSpec `json:"spec"`

	// Status is the status for the sync declaration.
	Status SyncStatus `json:"status,omitempty"`
}

Sync is used for configuring sync of generic resources.

func NewSync

func NewSync(gk schema.GroupKind) *Sync

NewSync creates a sync object for consumption by the syncer, this will only populate the group and kind as those are the only fields the syncer presently consumes.

func (*Sync) DeepCopy

func (in *Sync) DeepCopy() *Sync

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

func (*Sync) DeepCopyInto

func (in *Sync) DeepCopyInto(out *Sync)

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

func (*Sync) DeepCopyObject

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

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

type SyncList

type SyncList struct {
	metav1.TypeMeta `json:",inline"`

	// Standard object's metadata.
	// +optional
	metav1.ListMeta `json:"metadata,omitempty"`

	// Items is a list of sync declarations.
	Items []Sync `json:"items"`
}

SyncList holds a list of Sync resources.

func (*SyncList) DeepCopy

func (in *SyncList) DeepCopy() *SyncList

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

func (*SyncList) DeepCopyInto

func (in *SyncList) DeepCopyInto(out *SyncList)

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

func (*SyncList) DeepCopyObject

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

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

type SyncSpec

type SyncSpec struct {
	// Group is the group, for example configmanagement.gke.io or rbac.authorization.k8s.io
	Group string `json:"group"` // group, eg configmanagement.gke.io
	// Kind is the string that represents the Kind for the object as given in TypeMeta, for example
	// ClusterRole, Namespace or Deployment.
	Kind string `json:"kind"`
	// HierarchyMode specifies how the object is treated when it appears in an abstract namespace.
	// The default is "inherit", meaning objects are inherited from parent abstract namespaces.
	// If set to "none", the type is not allowed in Abstract Namespaces.
	// +optional
	HierarchyMode HierarchyModeType `json:"hierarchyMode,omitempty"`
}

SyncSpec specifies the sync declaration which corresponds to an API Group and contained kinds and versions.

func (*SyncSpec) DeepCopy

func (in *SyncSpec) DeepCopy() *SyncSpec

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

func (*SyncSpec) DeepCopyInto

func (in *SyncSpec) DeepCopyInto(out *SyncSpec)

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

type SyncState

type SyncState string

SyncState indicates the state of a sync for resources of a particular group and kind.

const (
	// Syncing indicates these resources are being actively managed by Nomos.
	Syncing SyncState = "syncing"
)

type SyncStatus

type SyncStatus struct {
	// Status indicates the state of the sync.  One of "syncing", or "error".  If "error" is specified
	// then Error will be populated with a message regarding the error.
	Status SyncState `json:"status"`
	// Message indicates a message associated with the status.
	// +optional
	Message string `json:"message,omitempty"`
}

SyncStatus represents the status for a sync declaration

func (*SyncStatus) DeepCopy

func (in *SyncStatus) DeepCopy() *SyncStatus

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

func (*SyncStatus) DeepCopyInto

func (in *SyncStatus) DeepCopyInto(out *SyncStatus)

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

Directories

Path Synopsis
Package repo contains the user interface definition for the repo structure.
Package repo contains the user interface definition for the repo structure.

Jump to

Keyboard shortcuts

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