const ( // HealthyCondition is the condition type used // to record the last health assessment result. HealthyCondition string = "Healthy" // PruneFailedReason represents the fact that the // pruning of the Kustomization failed. PruneFailedReason string = "PruneFailed" // ArtifactFailedReason represents the fact that the // artifact download of the kustomization failed. ArtifactFailedReason string = "ArtifactFailed" // BuildFailedReason represents the fact that the // kustomize build of the Kustomization failed. BuildFailedReason string = "BuildFailed" // HealthCheckFailedReason represents the fact that // one of the health checks of the Kustomization failed. HealthCheckFailedReason string = "HealthCheckFailed" // ValidationFailedReason represents the fact that the // validation of the Kustomization manifests has failed. ValidationFailedReason string = "ValidationFailed" )
const ( KustomizationKind = "Kustomization" KustomizationFinalizer = "finalizers.fluxcd.io" MaxConditionMessageLength = 20000 DisabledValue = "disabled" )
const ( // GitRepositoryIndexKey is the key used for indexing kustomizations // based on their Git sources. GitRepositoryIndexKey string = ".metadata.gitRepository" // BucketIndexKey is the key used for indexing kustomizations // based on their S3 sources. BucketIndexKey string = ".metadata.bucket" )
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "kustomize.toolkit.fluxcd.io", Version: "v1beta1"} // 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 )
CrossNamespaceSourceReference contains enough information to let you locate the typed referenced object at cluster level
type CrossNamespaceSourceReference struct { // API version of the referent // +optional APIVersion string `json:"apiVersion,omitempty"` // Kind of the referent // +kubebuilder:validation:Enum=GitRepository;Bucket // +required Kind string `json:"kind"` // Name of the referent // +required Name string `json:"name"` // Namespace of the referent, defaults to the Kustomization namespace // +optional Namespace string `json:"namespace,omitempty"` }
func (in *CrossNamespaceSourceReference) DeepCopy() *CrossNamespaceSourceReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceSourceReference.
func (in *CrossNamespaceSourceReference) DeepCopyInto(out *CrossNamespaceSourceReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (s *CrossNamespaceSourceReference) String() string
Decryption defines how decryption is handled for Kubernetes manifests.
type Decryption struct { // Provider is the name of the decryption engine. // +kubebuilder:validation:Enum=sops // +required Provider string `json:"provider"` // The secret name containing the private OpenPGP keys used for decryption. // +optional SecretRef *meta.LocalObjectReference `json:"secretRef,omitempty"` }
func (in *Decryption) DeepCopy() *Decryption
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Decryption.
func (in *Decryption) DeepCopyInto(out *Decryption)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
KubeConfig references a Kubernetes secret that contains a kubeconfig file.
type KubeConfig struct { // SecretRef holds the name to a secret that contains a 'value' key with // the kubeconfig file as the value. It must be in the same namespace as // the Kustomization. // It is recommended that the kubeconfig is self-contained, and the secret // is regularly updated if credentials such as a cloud-access-token expire. // Cloud specific `cmd-path` auth helpers will not function without adding // binaries and credentials to the Pod that is responsible for reconciling // the Kustomization. // +required SecretRef meta.LocalObjectReference `json:"secretRef,omitempty"` }
func (in *KubeConfig) DeepCopy() *KubeConfig
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KubeConfig.
func (in *KubeConfig) DeepCopyInto(out *KubeConfig)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Kustomization is the Schema for the kustomizations API.
type Kustomization struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec KustomizationSpec `json:"spec,omitempty"` // +kubebuilder:default:={"observedGeneration":-1} Status KustomizationStatus `json:"status,omitempty"` }
func (in *Kustomization) DeepCopy() *Kustomization
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Kustomization.
func (in *Kustomization) DeepCopyInto(out *Kustomization)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *Kustomization) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (in Kustomization) GetDependsOn() (types.NamespacedName, []meta.NamespacedObjectReference)
func (in Kustomization) GetRetryInterval() time.Duration
GetRetryInterval returns the retry interval
func (in *Kustomization) GetStatusConditions() *[]metav1.Condition
GetStatusConditions returns a pointer to the Status.Conditions slice
func (in Kustomization) GetTimeout() time.Duration
GetTimeout returns the timeout with default.
KustomizationList contains a list of kustomizations.
type KustomizationList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Kustomization `json:"items"` }
func (in *KustomizationList) DeepCopy() *KustomizationList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizationList.
func (in *KustomizationList) DeepCopyInto(out *KustomizationList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (in *KustomizationList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
KustomizationSpec defines the desired state of a kustomization.
type KustomizationSpec struct { // DependsOn may contain a meta.NamespacedObjectReference slice // with references to Kustomization resources that must be ready before this // Kustomization can be reconciled. // +optional DependsOn []meta.NamespacedObjectReference `json:"dependsOn,omitempty"` // Decrypt Kubernetes secrets before applying them on the cluster. // +optional Decryption *Decryption `json:"decryption,omitempty"` // The interval at which to reconcile the Kustomization. // +required Interval metav1.Duration `json:"interval"` // The interval at which to retry a previously failed reconciliation. // When not specified, the controller uses the KustomizationSpec.Interval // value to retry failures. // +optional RetryInterval *metav1.Duration `json:"retryInterval,omitempty"` // The KubeConfig for reconciling the Kustomization on a remote cluster. // When specified, KubeConfig takes precedence over ServiceAccountName. // +optional KubeConfig *KubeConfig `json:"kubeConfig,omitempty"` // Path to the directory containing the kustomization.yaml file, or the // set of plain YAMLs a kustomization.yaml should be generated for. // Defaults to 'None', which translates to the root path of the SourceRef. // +optional Path string `json:"path,omitempty"` // PostBuild describes which actions to perform on the YAML manifest // generated by building the kustomize overlay. // +optional PostBuild *PostBuild `json:"postBuild,omitempty"` // Prune enables garbage collection. // +required Prune bool `json:"prune"` // A list of resources to be included in the health assessment. // +optional HealthChecks []meta.NamespacedObjectKindReference `json:"healthChecks,omitempty"` // Strategic merge and JSON patches, defined as inline YAML objects, // capable of targeting objects based on kind, label and annotation selectors. // +optional Patches []kustomize.Patch `json:"patches,omitempty"` // Strategic merge patches, defined as inline YAML objects. // +optional PatchesStrategicMerge []apiextensionsv1.JSON `json:"patchesStrategicMerge,omitempty"` // JSON 6902 patches, defined as inline YAML objects. // +optional PatchesJSON6902 []kustomize.JSON6902Patch `json:"patchesJson6902,omitempty"` // Images is a list of (image name, new name, new tag or digest) // for changing image names, tags or digests. This can also be achieved with a // patch, but this operator is simpler to specify. // +optional Images []kustomize.Image `json:"images,omitempty"` // The name of the Kubernetes service account to impersonate // when reconciling this Kustomization. // +optional ServiceAccountName string `json:"serviceAccountName,omitempty"` // Reference of the source where the kustomization file is. // +required SourceRef CrossNamespaceSourceReference `json:"sourceRef"` // This flag tells the controller to suspend subsequent kustomize executions, // it does not apply to already started executions. Defaults to false. // +optional Suspend bool `json:"suspend,omitempty"` // TargetNamespace sets or overrides the namespace in the // kustomization.yaml file. // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=63 // +kubebuilder:validation:Optional // +optional TargetNamespace string `json:"targetNamespace,omitempty"` // Timeout for validation, apply and health checking operations. // Defaults to 'Interval' duration. // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` // Validate the Kubernetes objects before applying them on the cluster. // The validation strategy can be 'client' (local dry-run), 'server' // (APIServer dry-run) or 'none'. // When 'Force' is 'true', validation will fallback to 'client' if set to // 'server' because server-side validation is not supported in this scenario. // +kubebuilder:validation:Enum=none;client;server // +optional Validation string `json:"validation,omitempty"` // Force instructs the controller to recreate resources // when patching fails due to an immutable field change. // +kubebuilder:default:=false // +optional Force bool `json:"force,omitempty"` }
func (in *KustomizationSpec) DeepCopy() *KustomizationSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizationSpec.
func (in *KustomizationSpec) DeepCopyInto(out *KustomizationSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
KustomizationStatus defines the observed state of a kustomization.
type KustomizationStatus struct { // ObservedGeneration is the last reconciled generation. // +optional ObservedGeneration int64 `json:"observedGeneration,omitempty"` // +optional Conditions []metav1.Condition `json:"conditions,omitempty"` // The last successfully applied revision. // The revision format for Git sources is <branch|tag>/<commit-sha>. // +optional LastAppliedRevision string `json:"lastAppliedRevision,omitempty"` // LastAttemptedRevision is the revision of the last reconciliation attempt. // +optional LastAttemptedRevision string `json:"lastAttemptedRevision,omitempty"` meta.ReconcileRequestStatus `json:",inline"` // The last successfully applied revision metadata. // +optional Snapshot *Snapshot `json:"snapshot,omitempty"` }
func (in *KustomizationStatus) DeepCopy() *KustomizationStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KustomizationStatus.
func (in *KustomizationStatus) DeepCopyInto(out *KustomizationStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
PostBuild describes which actions to perform on the YAML manifest generated by building the kustomize overlay.
type PostBuild struct { // Substitute holds a map of key/value pairs. // The variables defined in your YAML manifests // that match any of the keys defined in the map // will be substituted with the set value. // Includes support for bash string replacement functions // e.g. ${var:=default}, ${var:position} and ${var/substring/replacement}. // +optional Substitute map[string]string `json:"substitute,omitempty"` // SubstituteFrom holds references to ConfigMaps and Secrets containing // the variables and their values to be substituted in the YAML manifests. // The ConfigMap and the Secret data keys represent the var names and they // must match the vars declared in the manifests for the substitution to happen. // +optional SubstituteFrom []SubstituteReference `json:"substituteFrom,omitempty"` }
func (in *PostBuild) DeepCopy() *PostBuild
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PostBuild.
func (in *PostBuild) DeepCopyInto(out *PostBuild)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
Snapshot holds the metadata of the Kubernetes objects generated for a source revision
type Snapshot struct { // The manifests sha1 checksum. // +required Checksum string `json:"checksum"` // A list of Kubernetes kinds grouped by namespace. // +required Entries []SnapshotEntry `json:"entries"` }
func NewSnapshot(manifests []byte, checksum string) (*Snapshot, error)
func (in *Snapshot) DeepCopy() *Snapshot
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Snapshot.
func (in *Snapshot) DeepCopyInto(out *Snapshot)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (s *Snapshot) NamespacedKinds() map[string][]schema.GroupVersionKind
func (s *Snapshot) NonNamespacedKinds() []schema.GroupVersionKind
Snapshot holds the metadata of namespaced Kubernetes objects
type SnapshotEntry struct { // The namespace of this entry. // +optional Namespace string `json:"namespace"` // The list of Kubernetes kinds. // +required Kinds map[string]string `json:"kinds"` }
func (in *SnapshotEntry) DeepCopy() *SnapshotEntry
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SnapshotEntry.
func (in *SnapshotEntry) DeepCopyInto(out *SnapshotEntry)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
SubstituteReference contains a reference to a resource containing the variables name and value.
type SubstituteReference struct { // Kind of the values referent, valid values are ('Secret', 'ConfigMap'). // +kubebuilder:validation:Enum=Secret;ConfigMap // +required Kind string `json:"kind"` // Name of the values referent. Should reside in the same namespace as the // referring resource. // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 // +required Name string `json:"name"` }
func (in *SubstituteReference) DeepCopy() *SubstituteReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SubstituteReference.
func (in *SubstituteReference) DeepCopyInto(out *SubstituteReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.