v1

package
v0.3.0 Latest Latest
Warning

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

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

Documentation

Overview

Package v1 contains API Schema definitions for the projection v1 API group +kubebuilder:object:generate=true +groupName=projection.sh

Index

Constants

This section is empty.

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "projection.sh", Version: "v1"}

	// 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
)

Functions

This section is empty.

Types

type ClusterProjection added in v0.3.0

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

	Spec   ClusterProjectionSpec   `json:"spec,omitempty"`
	Status ClusterProjectionStatus `json:"status,omitempty"`
}

ClusterProjection mirrors one source object into many destination namespaces.

func (*ClusterProjection) DeepCopy added in v0.3.0

func (in *ClusterProjection) DeepCopy() *ClusterProjection

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

func (*ClusterProjection) DeepCopyInto added in v0.3.0

func (in *ClusterProjection) DeepCopyInto(out *ClusterProjection)

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

func (*ClusterProjection) DeepCopyObject added in v0.3.0

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

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

type ClusterProjectionDestination added in v0.3.0

type ClusterProjectionDestination struct {
	// Namespaces is an explicit list of destination namespaces. Mutually
	// exclusive with NamespaceSelector. Each entry is a DNS-1123 label;
	// at least one entry is required when this field is set.
	// +optional
	// +listType=set
	// +kubebuilder:validation:MinItems=1
	Namespaces []string `json:"namespaces,omitempty"`

	// NamespaceSelector picks destination namespaces by label. Mutually
	// exclusive with Namespaces.
	// +optional
	NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`

	// Name in each destination namespace (DNS-1123 subdomain). Defaults to
	// Source.Name when empty. The same Name is written into every targeted
	// namespace.
	// +optional
	// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name,omitempty"`
}

ClusterProjectionDestination is the cluster-scoped destination spec.

`namespaces` and `namespaceSelector` are mutually exclusive (CEL admission) and at least one must be set.

+kubebuilder:validation:XValidation:rule="!(has(self.namespaces) && has(self.namespaceSelector))",message="namespaces and namespaceSelector are mutually exclusive" +kubebuilder:validation:XValidation:rule="has(self.namespaces) || has(self.namespaceSelector)",message="one of namespaces or namespaceSelector must be set"

func (*ClusterProjectionDestination) DeepCopy added in v0.3.0

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

func (*ClusterProjectionDestination) DeepCopyInto added in v0.3.0

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

type ClusterProjectionList added in v0.3.0

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

ClusterProjectionList contains a list of ClusterProjection.

func (*ClusterProjectionList) DeepCopy added in v0.3.0

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

func (*ClusterProjectionList) DeepCopyInto added in v0.3.0

func (in *ClusterProjectionList) DeepCopyInto(out *ClusterProjectionList)

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

func (*ClusterProjectionList) DeepCopyObject added in v0.3.0

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

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

type ClusterProjectionSpec added in v0.3.0

type ClusterProjectionSpec struct {
	// Source identifies the object to project.
	Source SourceRef `json:"source"`

	// Destination configures the fan-out target set and optional rename.
	Destination ClusterProjectionDestination `json:"destination"`

	// Overlay applies metadata patches uniformly to every projected copy.
	// (Per-target overlays are not supported in v0.3.)
	// +optional
	Overlay Overlay `json:"overlay,omitempty"`
}

ClusterProjectionSpec is the desired state of a cluster-scoped Projection.

A ClusterProjection fans out one source object into many namespaces selected by either an explicit list or a label selector. Cluster-tier authority is required to create one — the chart does NOT aggregate the `clusterprojections` CRUD verbs into the built-in `admin`/`edit` roles.

func (*ClusterProjectionSpec) DeepCopy added in v0.3.0

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

func (*ClusterProjectionSpec) DeepCopyInto added in v0.3.0

func (in *ClusterProjectionSpec) DeepCopyInto(out *ClusterProjectionSpec)

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

type ClusterProjectionStatus added in v0.3.0

type ClusterProjectionStatus struct {
	// Conditions: SourceResolved, DestinationWritten, Ready.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// DestinationName is the resolved name of the destination object,
	// identical across all targeted namespaces. Populated after the first
	// successful write; empty before that.
	// +optional
	DestinationName string `json:"destinationName,omitempty"`

	// NamespacesWritten is the count of namespaces in which the destination
	// was successfully created or updated during the most recent reconcile.
	// +optional
	NamespacesWritten int32 `json:"namespacesWritten,omitempty"`

	// NamespacesFailed is the count of namespaces where the write failed
	// during the most recent reconcile. The DestinationWritten condition's
	// message carries a (truncated) list of failed namespace names.
	// +optional
	NamespacesFailed int32 `json:"namespacesFailed,omitempty"`
}

ClusterProjectionStatus reports the rollup of the most recent reconcile.

func (*ClusterProjectionStatus) DeepCopy added in v0.3.0

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

func (*ClusterProjectionStatus) DeepCopyInto added in v0.3.0

func (in *ClusterProjectionStatus) DeepCopyInto(out *ClusterProjectionStatus)

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

type Overlay

type Overlay struct {
	// Labels are merged onto the destination's metadata.labels. Overlay
	// entries win on key conflicts with the source (overlay-last semantics);
	// source-only and overlay-only keys are kept as-is.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`

	// Annotations are merged onto the destination's metadata.annotations.
	// Same overlay-wins merge rule as Labels.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`
}

Overlay applies metadata patches to the projected object on top of what the source carries. Only labels and annotations are mergeable — name and namespace cannot be touched (they are set by the controller from the destination spec).

func (*Overlay) DeepCopy

func (in *Overlay) DeepCopy() *Overlay

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

func (*Overlay) DeepCopyInto

func (in *Overlay) DeepCopyInto(out *Overlay)

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

type Projection

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

	Spec   ProjectionSpec   `json:"spec,omitempty"`
	Status ProjectionStatus `json:"status,omitempty"`
}

Projection mirrors one source object into the Projection's own namespace.

func (*Projection) DeepCopy

func (in *Projection) DeepCopy() *Projection

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

func (*Projection) DeepCopyInto

func (in *Projection) DeepCopyInto(out *Projection)

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

func (*Projection) DeepCopyObject

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

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

type ProjectionDestination added in v0.3.0

type ProjectionDestination struct {
	// Name in the destination namespace (DNS-1123 subdomain). Defaults to
	// Source.Name when empty.
	// +optional
	// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name,omitempty"`
}

ProjectionDestination configures the rename override for a namespaced Projection.

func (*ProjectionDestination) DeepCopy added in v0.3.0

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

func (*ProjectionDestination) DeepCopyInto added in v0.3.0

func (in *ProjectionDestination) DeepCopyInto(out *ProjectionDestination)

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

type ProjectionList

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

ProjectionList contains a list of Projection.

func (*ProjectionList) DeepCopy

func (in *ProjectionList) DeepCopy() *ProjectionList

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

func (*ProjectionList) DeepCopyInto

func (in *ProjectionList) DeepCopyInto(out *ProjectionList)

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

func (*ProjectionList) DeepCopyObject

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

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

type ProjectionSpec

type ProjectionSpec struct {
	// Source identifies the object to project.
	Source SourceRef `json:"source"`

	// Destination optionally renames the destination. The destination
	// namespace is implicitly the Projection's own namespace and cannot
	// be set; for cross-namespace mirroring use ClusterProjection.
	// +optional
	Destination ProjectionDestination `json:"destination,omitempty"`

	// Overlay applies metadata patches on top of the projected object.
	// +optional
	Overlay Overlay `json:"overlay,omitempty"`
}

ProjectionSpec is the desired state of a namespaced Projection.

A Projection mirrors one source object into the Projection's own namespace. It cannot write outside its own namespace — that is what ClusterProjection is for. This narrowness is deliberate: it makes namespace-scoped RBAC on `projections.projection.sh` a structural confinement, not a policy hint.

func (*ProjectionSpec) DeepCopy

func (in *ProjectionSpec) DeepCopy() *ProjectionSpec

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

func (*ProjectionSpec) DeepCopyInto

func (in *ProjectionSpec) DeepCopyInto(out *ProjectionSpec)

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

type ProjectionStatus

type ProjectionStatus struct {
	// Conditions: SourceResolved, DestinationWritten, Ready.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// DestinationName is the resolved name of the destination object after
	// applying any rename override (`spec.destination.name`) or defaulting to
	// `spec.source.name`. Populated by the controller after a successful
	// write; empty before the first reconcile completes.
	// +optional
	DestinationName string `json:"destinationName,omitempty"`
}

ProjectionStatus reports the most recent reconcile outcome.

func (*ProjectionStatus) DeepCopy

func (in *ProjectionStatus) DeepCopy() *ProjectionStatus

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

func (*ProjectionStatus) DeepCopyInto

func (in *ProjectionStatus) DeepCopyInto(out *ProjectionStatus)

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

type SourceRef

type SourceRef struct {
	// Group is the API group of the source object. Empty string means the
	// core group (e.g. ConfigMap, Secret, Service).
	// +optional
	// +kubebuilder:validation:Pattern=`^$|^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
	Group string `json:"group,omitempty"`

	// Version is the API version of the source object within its Group. Omit
	// for non-core groups to use the RESTMapper's preferred served version
	// (the source automatically follows CRD version promotions). When set,
	// must match Kubernetes' canonical version-string shape (`vN`,
	// `vNalphaM`, `vNbetaM`).
	// +optional
	// +kubebuilder:validation:Pattern=`^$|^v[0-9]+((alpha|beta)[0-9]+)?$`
	Version string `json:"version,omitempty"`

	// Kind is the API Kind of the source object (PascalCase).
	// +kubebuilder:validation:Pattern=`^[A-Z][a-zA-Z0-9]*$`
	Kind string `json:"kind"`

	// Namespace where the source object lives.
	// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
	// +kubebuilder:validation:MaxLength=63
	Namespace string `json:"namespace"`

	// Name of the source object (DNS-1123 subdomain).
	// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
	// +kubebuilder:validation:MaxLength=253
	Name string `json:"name"`
}

SourceRef identifies the object to project.

Group + Version + Kind name the GVK; Namespace + Name name the object.

`version` may be omitted for non-core groups, in which case the operator resolves the preferred served version via the RESTMapper on every reconcile. The core group has only `v1` as a stable form, so `version` MUST be set when `group` is empty — enforced by the CEL rule below.

+kubebuilder:validation:XValidation:rule="size(self.group) != 0 || size(self.version) != 0",message="version is required when group is empty (no unpinned form for core)"

func (*SourceRef) DeepCopy

func (in *SourceRef) DeepCopy() *SourceRef

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

func (*SourceRef) DeepCopyInto

func (in *SourceRef) DeepCopyInto(out *SourceRef)

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

Jump to

Keyboard shortcuts

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