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 ¶
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 DestinationRef ¶
type DestinationRef struct {
// Namespace to project into. Defaults to the Projection's own namespace.
// Mutually exclusive with NamespaceSelector.
// +optional
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
Namespace string `json:"namespace,omitempty"`
// NamespaceSelector selects namespaces to project into by label.
// Mutually exclusive with Namespace.
// +optional
NamespaceSelector *metav1.LabelSelector `json:"namespaceSelector,omitempty"`
// Name in the destination namespace. Defaults to Source.Name. DNS-1123
// subdomain: lowercase alphanumerics, '-', and '.', up to 253 chars.
// +optional
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
Name string `json:"name,omitempty"`
}
DestinationRef identifies where the projected object should be written. Invariant: namespace and namespaceSelector are mutually exclusive. Enforced at admission time by the CEL rule below (requires k8s 1.32+) and, as defense-in-depth, also by the reconciler. +kubebuilder:validation:XValidation:rule="!(has(self.namespace) && has(self.namespaceSelector))",message="destination.namespace and destination.namespaceSelector are mutually exclusive"
func (*DestinationRef) DeepCopy ¶
func (in *DestinationRef) DeepCopy() *DestinationRef
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DestinationRef.
func (*DestinationRef) DeepCopyInto ¶
func (in *DestinationRef) DeepCopyInto(out *DestinationRef)
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 with the source object's metadata.labels before
// writing to the destination. Keys set here win on conflict with
// source labels.
// +optional
Labels map[string]string `json:"labels,omitempty"`
// Annotations are merged with the source object's metadata.annotations
// before writing to the destination. Keys set here win on conflict
// with source annotations. Note: the controller always overwrites
// projection.sh/owned-by to its own bookkeeping value;
// attempts to set it here are ignored.
// +optional
Annotations map[string]string `json:"annotations,omitempty"`
}
Overlay is applied on top of the source object's metadata before writing to the destination. Overlay entries win on key conflicts with the source.
func (*Overlay) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Overlay.
func (*Overlay) DeepCopyInto ¶
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 Kubernetes object from a source location to one or more destination namespaces, declaratively and conflict-safely. Source edits propagate to destinations in ~100 ms via dynamic watches. Destinations carry a projection.sh/owned-by annotation the controller uses to refuse overwriting resources it did not create.
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 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 is the object to project from.
Source SourceRef `json:"source"`
// Destination controls where the projected object is written.
// +optional
Destination DestinationRef `json:"destination,omitempty"`
// Overlay applies metadata patches on top of the projected object.
// +optional
Overlay Overlay `json:"overlay,omitempty"`
}
ProjectionSpec specifies which source object to mirror, where to write it, and what metadata overlays to apply.
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 reflect the current state of the projection. The controller
// sets type "Ready" to True once the destination has been written, or
// False with a reason describing why not.
// +optional
Conditions []metav1.Condition `json:"conditions,omitempty"`
}
ProjectionStatus reports the most recent reconcile outcome via three conditions: SourceResolved, DestinationWritten, and Ready.
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 {
// APIVersion of the source object. Three forms accepted:
// - "v1" — core group, pinned to v1.
// - "apps/v1" — named group, pinned to v1.
// - "apps/*" — named group, RESTMapper-preferred served version.
// The unpinned form follows the cluster: when a CRD author promotes
// v1beta1→v1, projection picks up the new preferred version on the
// next reconcile rather than reporting SourceResolutionFailed.
// The "*" sentinel is invalid without a group prefix (no "*" form
// for the core group, which has stable versions); enforced in the
// reconciler since the regex is permissive for simplicity.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^([a-z0-9.-]+/)?(v[0-9]+((alpha|beta)[0-9]+)?|\*)$`
APIVersion string `json:"apiVersion"`
// Kind of the source object, e.g. "ConfigMap".
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:Pattern=`^[A-Z][A-Za-z0-9]*$`
Kind string `json:"kind"`
// Name of the source object. DNS-1123 subdomain: lowercase alphanumerics,
// '-', and '.', up to 253 chars. Matches the permissive form Kubernetes
// uses for most named objects (ConfigMap, Secret, Deployment, Pod, …).
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=253
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$`
Name string `json:"name"`
// Namespace of the source object.
// +kubebuilder:validation:Required
// +kubebuilder:validation:MinLength=1
// +kubebuilder:validation:MaxLength=63
// +kubebuilder:validation:Pattern=`^[a-z0-9]([-a-z0-9]*[a-z0-9])?$`
Namespace string `json:"namespace"`
}
SourceRef identifies the Kubernetes object to project from.
func (*SourceRef) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SourceRef.
func (*SourceRef) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.