v1beta1

package
v2.3.0 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2026 License: Apache-2.0 Imports: 9 Imported by: 6

Documentation

Overview

Package v1beta1 contains API Schema definitions for the source v1beta1 API group +kubebuilder:object:generate=true +groupName=source.extensions.fluxcd.io

Index

Constants

View Source
const (
	ArtifactGeneratorKind            = "ArtifactGenerator"
	Finalizer                        = "source.extensions.fluxcd.io/finalizer"
	ArtifactGeneratorLabel           = "source.extensions.fluxcd.io/generator"
	ArtifactOriginRevisionAnnotation = "org.opencontainers.image.revision"
	ReconcileAnnotation              = "source.extensions.fluxcd.io/reconcile"
	ReconcileEveryAnnotation         = "source.extensions.fluxcd.io/reconcileEvery"
	PruneAnnotation                  = "source.extensions.fluxcd.io/prune"
	SSAAnnotation                    = "source.extensions.fluxcd.io/ssa"
	ExternalFinalizerAnnotation      = "source.extensions.fluxcd.io/externalFinalizer"
	ReconciliationDisabledReason     = "ReconciliationDisabled"
	AccessDeniedReason               = "AccessDenied"
	ValidationFailedReason           = "ValidationFailed"
	SourceFetchFailedReason          = "SourceFetchFailed"
	OwnershipConflictReason          = "OwnershipConflict"
	OverwriteStrategy                = "Overwrite"
	MergeStrategy                    = "Merge"
	ExtractStrategy                  = "Extract"
	OverrideStrategy                 = "Override"
	EnabledValue                     = "Enabled"
	DisabledValue                    = "Disabled"
	MergeValue                       = "Merge"
	IfNotPresentValue                = "IfNotPresent"
	IgnoreValue                      = "Ignore"
	NamespaceKind                    = "Namespace"
	AdoptedReason                    = "Adopted"
	NamespaceMetadataKind            = "NamespaceMetadata"
	NamespaceMetadataResetStrategy   = "Reset"
	ArtifactAlias                    = "artifact"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "source.extensions.fluxcd.io", Version: "v1beta1"}

	// SchemeBuilder is used to add go types to the GroupVersionKind scheme
	SchemeBuilder = runtime.NewSchemeBuilder(addKnownTypes)

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

Functions

func HashObservedSources

func HashObservedSources(sources map[string]ObservedSource) string

HashObservedSources computes a hash of the ObservedSource map. It sorts the formatted source strings to ensure consistent hashing. The resulting hash is a SHA-256 digest represented as a hexadecimal string.

Types

type Action added in v2.3.0

type Action string

Action describes an observable stage of the ArtifactGenerator reconcile loop, from validating the spec and resolving sources through building, publishing, pruning and finalizing the generated artifacts.

const (
	// ActionReconcile denotes the overall outcome of the reconcile loop,
	// emitted once per run to report that reconciliation finished or failed.
	ActionReconcile Action = "Reconcile"

	// ActionResolveSource resolves the referenced GitRepository, OCIRepository,
	// Bucket, HelmChart and ExternalArtifact sources and records their
	// advertised artifact URL, digest and revision.
	ActionResolveSource Action = "ResolveSource"

	// ActionFetchSource downloads and extracts each resolved source tarball
	// into a per-alias working directory before the artifacts are built.
	ActionFetchSource Action = "FetchSource"

	// ActionBuild composes and decomposes the fetched sources into output
	// artifacts by running the glob-based copy, merge and extract operations.
	ActionBuild Action = "Build"

	// ActionPublish writes each built tarball to storage and applies the
	// corresponding ExternalArtifact object with its revision metadata.
	ActionPublish Action = "Publish"
)

func (Action) String added in v2.3.0

func (a Action) String() string

String returns the string representation of the Action.

type ArtifactGenerator

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

	Spec   ArtifactGeneratorSpec   `json:"spec,omitempty"`
	Status ArtifactGeneratorStatus `json:"status,omitempty"`
}

ArtifactGenerator is the Schema for the artifactgenerators API.

func (*ArtifactGenerator) DeepCopy

func (in *ArtifactGenerator) DeepCopy() *ArtifactGenerator

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

func (*ArtifactGenerator) DeepCopyInto

func (in *ArtifactGenerator) DeepCopyInto(out *ArtifactGenerator)

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

func (*ArtifactGenerator) DeepCopyObject

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

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

func (*ArtifactGenerator) GetArtifactNamespace added in v2.3.0

func (in *ArtifactGenerator) GetArtifactNamespace(outputArtifact *OutputArtifact) string

GetArtifactNamespace returns the namespace where the ExternalArtifact generated for the given OutputArtifact is created. It defaults to the ArtifactGenerator namespace.

func (*ArtifactGenerator) GetConditions

func (in *ArtifactGenerator) GetConditions() []metav1.Condition

GetConditions returns the status conditions of the object.

func (*ArtifactGenerator) GetRequeueAfter

func (in *ArtifactGenerator) GetRequeueAfter() time.Duration

GetRequeueAfter returns the duration after which the ArtifactGenerator must be reconciled again. It defaults to one hour and can be overridden with the reconcileEvery annotation using a Go duration string.

func (*ArtifactGenerator) HasArtifactInInventory

func (in *ArtifactGenerator) HasArtifactInInventory(name, namespace, digest string) bool

HasArtifactInInventory returns true if the artifact with the given name, namespace, and digest exists in the inventory.

func (*ArtifactGenerator) HasNamespaceInInventory added in v2.3.0

func (in *ArtifactGenerator) HasNamespaceInInventory(name, digest string) bool

HasNamespaceInInventory returns true if the namespace with the given name and metadata digest exists in the inventory.

func (*ArtifactGenerator) IsDisabled

func (in *ArtifactGenerator) IsDisabled() bool

IsDisabled returns true if the object has the reconcile annotation set to 'disabled'.

func (*ArtifactGenerator) ManagesNamespaces added in v2.3.0

func (in *ArtifactGenerator) ManagesNamespaces() bool

ManagesNamespaces returns true when the controller manages the target namespaces of the generated artifacts.

func (*ArtifactGenerator) NamespacePrune added in v2.3.0

func (in *ArtifactGenerator) NamespacePrune() bool

NamespacePrune returns whether the controller prunes managed namespaces that are no longer targeted by any generated artifact, or when the ArtifactGenerator is deleted. The setting only applies when ManagesNamespaces() returns true.

func (*ArtifactGenerator) SetConditions

func (in *ArtifactGenerator) SetConditions(conditions []metav1.Condition)

SetConditions sets the status conditions on the object.

func (*ArtifactGenerator) SetLastHandledReconcileAt

func (in *ArtifactGenerator) SetLastHandledReconcileAt(value string)

SetLastHandledReconcileAt sets the last handled reconcile time in the status.

type ArtifactGeneratorList

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

ArtifactGeneratorList contains a list of ArtifactGenerator.

func (*ArtifactGeneratorList) DeepCopy

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

func (*ArtifactGeneratorList) DeepCopyInto

func (in *ArtifactGeneratorList) DeepCopyInto(out *ArtifactGeneratorList)

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

func (*ArtifactGeneratorList) DeepCopyObject

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

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

type ArtifactGeneratorSpec

type ArtifactGeneratorSpec struct {
	// CommonMetadata specifies the common labels and annotations that are
	// applied to all resources. Any existing label or annotation will be
	// overridden if its key matches a common one.
	// +optional
	CommonMetadata *CommonMetadata `json:"commonMetadata,omitempty"`

	// Sources is a list of references to the Flux source-controller
	// resources that will be used to generate the artifact.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=1000
	// +required
	Sources []SourceReference `json:"sources"`

	// ServiceAccountName is the name of the ServiceAccount used to authorize
	// the reconciliation of the generated ExternalArtifacts and the managed
	// Namespaces. The name is resolved in the ArtifactGenerator namespace. When
	// specified, the controller checks this ServiceAccount with
	// SubjectAccessReview for every namespace targeted by the generated
	// ExternalArtifacts, including the ArtifactGenerator namespace, and its
	// RBAC bindings determine the namespaces in which they can be created,
	// updated and deleted.
	// When not specified, the controller uses its own credentials for
	// ExternalArtifacts in the ArtifactGenerator namespace, and the
	// ServiceAccount configured with the --default-service-account flag
	// (when set) for artifacts targeting another namespace.
	// Namespace management (.spec.managedNamespaces) always requires a
	// ServiceAccount for authorization, so either this field or the
	// --default-service-account flag must be set; otherwise the reconciliation
	// fails with a terminal error. The controller performs the namespace
	// operations with its own credentials.
	// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// PathPattern specifies a directory traversal pattern to match within the sources.
	// The format is "@<alias>/<pattern>". Named captures in the pattern (e.g. "{app}")
	// can be used as placeholders in OutputArtifacts fields.
	// +kubebuilder:validation:Pattern="^@([a-z0-9]([a-z0-9_-]*[a-z0-9])?)/(.*)$"
	// +kubebuilder:validation:MaxLength=1024
	// +optional
	PathPattern string `json:"pathPattern,omitempty"`

	// ManagedNamespaces defines how the controller manages the namespaces
	// targeted by the generated artifacts. When omitted, the target namespaces
	// are unmanaged: they must already exist and are left untouched.
	// +optional
	ManagedNamespaces *ManagedNamespaces `json:"managedNamespaces,omitempty"`

	// OutputArtifacts is a list of output artifacts to be generated.
	// +kubebuilder:validation:MinItems=1
	// +kubebuilder:validation:MaxItems=1000
	// +required
	OutputArtifacts []OutputArtifact `json:"artifacts"`
}

ArtifactGeneratorSpec defines the desired state of ArtifactGenerator. +kubebuilder:validation:XValidation:rule="has(self.pathPattern) && size(self.pathPattern) > 0 || self.artifacts.all(a, a.name.matches('^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\\\\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*$') && a.name.size() <= 253)",message="artifact names must be valid Kubernetes object names when pathPattern is not set" +kubebuilder:validation:XValidation:rule="has(self.pathPattern) && size(self.pathPattern) > 0 || self.artifacts.all(a, !has(a.__namespace__) || (a.__namespace__.matches('^[a-z0-9]([-a-z0-9]*[a-z0-9])?$') && a.__namespace__.size() <= 63))",message="artifact namespaces must be valid Kubernetes namespaces when pathPattern is not set"

func (*ArtifactGeneratorSpec) DeepCopy

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

func (*ArtifactGeneratorSpec) DeepCopyInto

func (in *ArtifactGeneratorSpec) DeepCopyInto(out *ArtifactGeneratorSpec)

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

type ArtifactGeneratorStatus

type ArtifactGeneratorStatus struct {
	gotkmeta.ReconcileRequestStatus `json:",inline"`

	// Conditions holds the conditions for the ArtifactGenerator.
	// +optional
	Conditions []metav1.Condition `json:"conditions,omitempty"`

	// Inventory contains the list of objects managed by the ArtifactGenerator,
	// such as the generated ExternalArtifacts and the managed Namespaces.
	// +optional
	Inventory []InventoryEntry `json:"inventory,omitempty"`

	// ObservedSourcesDigest is a hash representing the current state of
	// all the sources referenced by the ArtifactGenerator.
	// +optional
	ObservedSourcesDigest string `json:"observedSourcesDigest,omitempty"`
}

ArtifactGeneratorStatus defines the observed state of ArtifactGenerator.

func (*ArtifactGeneratorStatus) DeepCopy

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

func (*ArtifactGeneratorStatus) DeepCopyInto

func (in *ArtifactGeneratorStatus) DeepCopyInto(out *ArtifactGeneratorStatus)

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

type CommonMetadata added in v2.2.0

type CommonMetadata struct {
	// Annotations to be added to the object's metadata.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Labels to be added to the object's metadata.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
}

CommonMetadata defines the common labels and annotations.

func (*CommonMetadata) DeepCopy added in v2.2.0

func (in *CommonMetadata) DeepCopy() *CommonMetadata

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

func (*CommonMetadata) DeepCopyInto added in v2.2.0

func (in *CommonMetadata) DeepCopyInto(out *CommonMetadata)

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

type CopyOperation

type CopyOperation struct {
	// From specifies the source (by alias) and the glob pattern to match files.
	// The format is "@<alias>/<glob-pattern>". When pathPattern is set,
	// the path may use capture placeholders such as "{app}".
	// +kubebuilder:validation:Pattern="^@([a-z0-9]([a-z0-9_-]*[a-z0-9])?)/(.*)$"
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=1024
	// +required
	From string `json:"from"`

	// To specifies the destination path within the artifact.
	// The format is "@artifact/path", the alias "artifact"
	// refers to the root path of the generated artifact. When pathPattern
	// is set, the path may use capture placeholders such as "{app}".
	// +kubebuilder:validation:Pattern="^@artifact/([^/]{0,1}|[^./][^/]|[.][^./]|[^/]{3,})(/([^/]{0,1}|[^./][^/]|[.][^./]|[^/]{3,}))*$"
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=1024
	// +required
	To string `json:"to"`

	// Exclude specifies a list of glob patterns to exclude
	// files and dirs matched by the 'From' field. Patterns are matched
	// against paths relative to the source alias root or to the non-glob
	// prefix of 'From'. Patterns without a separator (e.g. "*.md") match
	// the file name at any depth.
	// +kubebuilder:validation:MaxItems=100
	// +kubebuilder:validation:items:MaxLength=1024
	// +optional
	Exclude []string `json:"exclude,omitempty"`

	// Strategy specifies the copy strategy to use.
	// 'Overwrite' will overwrite existing files in the destination.
	// 'Merge' is for merging YAML files using Helm values merge strategy.
	// 'Extract' is for extracting the contents of tarball archives (.tar.gz, .tgz)
	// When using glob patterns, non-tarball files are silently skipped. For single file sources,
	// the file must be a tarball or an error is returned. Directories are not supported.
	// If not specified, defaults to 'Overwrite'.
	// +optional
	// +kubebuilder:validation:Enum=Overwrite;Merge;Extract
	Strategy string `json:"strategy,omitempty"`

	// Optional, when set to true, allows the copy operation to silently
	// skip when the source path or glob pattern matches no files.
	// When false (default), the reconciliation fails with an error if
	// no files are matched.
	// +optional
	Optional bool `json:"optional,omitempty"`
}

func (*CopyOperation) DeepCopy

func (in *CopyOperation) DeepCopy() *CopyOperation

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

func (*CopyOperation) DeepCopyInto

func (in *CopyOperation) DeepCopyInto(out *CopyOperation)

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

type InventoryEntry added in v2.3.0

type InventoryEntry struct {
	// Kind is the kind of the referent object.
	// +kubebuilder:validation:Enum=ExternalArtifact;Namespace
	// +optional
	Kind string `json:"kind,omitempty"`

	// Name of the referent object.
	// +required
	Name string `json:"name"`

	// Namespace of the referent object. Empty for cluster-scoped objects.
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Digest of the referent object. For generated artifacts this is the
	// artifact content digest; for managed namespaces this is a digest of the
	// metadata applied by the controller.
	// +required
	Digest string `json:"digest"`

	// Filename is the name of the artifact file.
	// +optional
	Filename string `json:"filename,omitempty"`
}

InventoryEntry contains a reference to an object managed by the ArtifactGenerator, such as a generated ExternalArtifact or a managed Namespace.

func (*InventoryEntry) DeepCopy added in v2.3.0

func (in *InventoryEntry) DeepCopy() *InventoryEntry

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

func (*InventoryEntry) DeepCopyInto added in v2.3.0

func (in *InventoryEntry) DeepCopyInto(out *InventoryEntry)

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

type ManagedNamespaces added in v2.3.0

type ManagedNamespaces struct {
	// AllowedNames is a list of CEL expressions that define the set of
	// namespaces the ArtifactGenerator agrees to manage. Each expression
	// receives the namespace name through the 'ns' string variable and must
	// return a boolean. A namespace is managed only when at least one
	// expression returns true. The 'default', 'kube-system', 'kube-public'
	// and 'flux-system' namespaces are always rejected, regardless of the
	// expressions.
	// +kubebuilder:validation:MinItems=1
	// +required
	AllowedNames []string `json:"allowedNames"`

	// Prune specifies whether the controller deletes managed namespaces that
	// are no longer targeted by any generated artifact, or when the
	// ArtifactGenerator is deleted.
	// +required
	Prune bool `json:"prune"`

	// Metadata defines how the metadata of the desired namespaces is built,
	// on top of .spec.commonMetadata.
	// +optional
	Metadata *ManagedNamespacesMetadata `json:"metadata,omitempty"`
}

ManagedNamespaces defines how the controller manages the namespaces targeted by the generated artifacts.

func (*ManagedNamespaces) DeepCopy added in v2.3.0

func (in *ManagedNamespaces) DeepCopy() *ManagedNamespaces

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

func (*ManagedNamespaces) DeepCopyInto added in v2.3.0

func (in *ManagedNamespaces) DeepCopyInto(out *ManagedNamespaces)

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

type ManagedNamespacesMetadata added in v2.3.0

type ManagedNamespacesMetadata struct {
	// FromSource sources namespace metadata from a NamespaceMetadata file
	// inside a source artifact.
	// +optional
	FromSource *NamespaceMetadataFromSource `json:"fromSource,omitempty"`

	// From is a list of metadata operations applied in order to the desired
	// namespaces, on top of .spec.commonMetadata and .fromSource.
	// +optional
	From []NamespaceMetadataFrom `json:"from,omitempty"`
}

ManagedNamespacesMetadata defines how the metadata of the desired namespaces is built. The metadata is constructed by applying .spec.commonMetadata first, then the metadata sourced from a NamespaceMetadata file, then the metadata operations in .from, in order. +kubebuilder:validation:XValidation:rule="has(self.fromSource) || (has(self.from) && size(self.from) > 0)",message="either fromSource or at least one from operation must be set"

func (*ManagedNamespacesMetadata) DeepCopy added in v2.3.0

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

func (*ManagedNamespacesMetadata) DeepCopyInto added in v2.3.0

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

type NamespaceMetadata added in v2.3.0

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

	// Metadata holds the labels and annotations provided for the namespace.
	// +optional
	Metadata NamespaceMetadataMetadata `json:"metadata,omitempty"`
}

NamespaceMetadata is a KRM-style configuration object that allows tenants to provide additional metadata for the namespaces managed by an ArtifactGenerator. It is read from a file inside a source artifact, as configured through .spec.managedNamespaces.metadata.fromSource, and is not a cluster-scoped Kubernetes resource.

Example:

apiVersion: source.extensions.fluxcd.io/v1beta1
kind: NamespaceMetadata
metadata:
  annotations:
    foo: bar
  labels:
    baz: qux

func (*NamespaceMetadata) DeepCopy added in v2.3.0

func (in *NamespaceMetadata) DeepCopy() *NamespaceMetadata

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

func (*NamespaceMetadata) DeepCopyInto added in v2.3.0

func (in *NamespaceMetadata) DeepCopyInto(out *NamespaceMetadata)

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

type NamespaceMetadataFrom added in v2.3.0

type NamespaceMetadataFrom struct {
	// Strategy specifies how the labels and annotations are applied.
	// 'Reset' clears all the existing labels and annotations before applying
	// the ones defined in the operation (fields that are not set clear the
	// corresponding metadata), 'Override' merges the ones defined in the
	// operation into the existing values, overriding existing keys, while
	// 'Merge' merges only the absent keys, preserving existing values.
	// +kubebuilder:validation:Enum=Reset;Override;Merge
	// +required
	Strategy string `json:"strategy"`

	// Namespace is the name of the desired namespace the metadata applies to,
	// or '*' to apply the metadata to all desired namespaces.
	// +kubebuilder:validation:Pattern="^(\\*|[a-z0-9]([-a-z0-9]*[a-z0-9])?)$"
	// +kubebuilder:validation:MaxLength=63
	// +required
	Namespace string `json:"namespace"`

	// Annotations to be applied to the namespace.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Labels to be applied to the namespace.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
}

NamespaceMetadataFrom defines a metadata operation applied to a desired namespace.

func (*NamespaceMetadataFrom) DeepCopy added in v2.3.0

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

func (*NamespaceMetadataFrom) DeepCopyInto added in v2.3.0

func (in *NamespaceMetadataFrom) DeepCopyInto(out *NamespaceMetadataFrom)

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

type NamespaceMetadataFromSource added in v2.3.0

type NamespaceMetadataFromSource struct {
	// Path is the path to the NamespaceMetadata file inside a source artifact,
	// in the format "@<alias>/<path>". When pathPattern is set, the path may
	// use capture placeholders such as "{namespace}". Only namespace-level
	// captures are allowed, so that every artifact targeting a namespace
	// resolves to the same file.
	// +kubebuilder:validation:Pattern="^@([a-z0-9]([a-z0-9_-]*[a-z0-9])?)/(.*)$"
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=1024
	// +required
	Path string `json:"path"`

	// AllowedAnnotations is a schema for the annotations that the
	// NamespaceMetadata file is allowed to set. Each key is an annotation key
	// and each value is a CEL expression that receives the annotation value
	// through the 'value' string variable and must return a boolean.
	// Annotations whose key is not present in this map are ignored, while
	// annotations whose value does not satisfy the respective expression are
	// rejected.
	// The expressions are compiled, so a malformed expression or one that
	// does not return a boolean fails validation at the start of the
	// reconciliation.
	// +optional
	AllowedAnnotations map[string]string `json:"allowedAnnotations,omitempty"`

	// AllowedLabels is a schema for the labels that the NamespaceMetadata
	// file is allowed to set. Each key is a label key and each value is a
	// CEL expression that receives the label value through the 'value' string
	// variable and must return a boolean. Labels whose key is not present in
	// this map are ignored, while labels whose value does not satisfy the
	// respective expression are rejected.
	// The expressions are compiled, so a malformed expression or one that
	// does not return a boolean fails validation at the start of the
	// reconciliation.
	// +optional
	AllowedLabels map[string]string `json:"allowedLabels,omitempty"`
}

NamespaceMetadataFromSource sources namespace metadata from a NamespaceMetadata file inside a source artifact. The file may contain labels and annotations for the desired namespace, constrained by the allowedAnnotations and allowedLabels schemas. +kubebuilder:validation:XValidation:rule="(has(self.allowedAnnotations) && size(self.allowedAnnotations) > 0) || (has(self.allowedLabels) && size(self.allowedLabels) > 0)",message="at least one annotation or label must be set"

func (*NamespaceMetadataFromSource) DeepCopy added in v2.3.0

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

func (*NamespaceMetadataFromSource) DeepCopyInto added in v2.3.0

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

type NamespaceMetadataMetadata added in v2.3.0

type NamespaceMetadataMetadata struct {
	// Annotations to be applied to the namespace.
	// +optional
	Annotations map[string]string `json:"annotations,omitempty"`

	// Labels to be applied to the namespace.
	// +optional
	Labels map[string]string `json:"labels,omitempty"`
}

NamespaceMetadataMetadata holds the labels and annotations provided for a namespace through a NamespaceMetadata file.

func (*NamespaceMetadataMetadata) DeepCopy added in v2.3.0

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

func (*NamespaceMetadataMetadata) DeepCopyInto added in v2.3.0

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

type ObservedSource

type ObservedSource struct {
	// Digest is the artifact digest of the upstream source.
	// +required
	Digest string `json:"digest"`

	// Revision is the artifact revision of the upstream source.
	// +required
	Revision string `json:"revision"`

	// OriginRevision holds the origin revision of the upstream source,
	// extracted from the 'org.opencontainers.image.revision' annotation,
	// if available in the source artifact metadata.
	// +optional
	OriginRevision string `json:"originRevision,omitempty"`

	// URL is the artifact URL of the upstream source.
	// +required
	URL string `json:"url"`
}

ObservedSource contains the observed state of an artifact source. This is used to track the state of the sources used to generate an artifact in the ArtifactGeneratorStatus.ObservedSourcesDigest field.

func (*ObservedSource) DeepCopy

func (in *ObservedSource) DeepCopy() *ObservedSource

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

func (*ObservedSource) DeepCopyInto

func (in *ObservedSource) DeepCopyInto(out *ObservedSource)

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

func (ObservedSource) String

func (os ObservedSource) String() string

String returns a formatted string representation of the ObservedSource.

type OutputArtifact

type OutputArtifact struct {
	// Name is the name of the generated artifact.
	// When pathPattern is set, this field may use capture placeholders such as "{app}".
	// The maximum length accommodates capture placeholders; the effective
	// limits are enforced by the CEL validation when pathPattern is not set.
	// +kubebuilder:validation:MaxLength=1024
	// +required
	Name string `json:"name"`

	// Namespace is the namespace of the generated artifact.
	// If not provided, defaults to the same namespace as the ArtifactGenerator.
	// When pathPattern is set, this field may use capture placeholders such as "{app}".
	// The credentials used to reconcile the artifact are described in
	// .spec.serviceAccountName: an explicit ServiceAccount applies to every
	// generated artifact, while the --default-service-account flag only applies
	// to artifacts in a namespace other than the ArtifactGenerator namespace.
	// The maximum length accommodates capture placeholders; the effective
	// limits are enforced by the CEL validation when pathPattern is not set.
	// +kubebuilder:validation:MaxLength=1024
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// InputsFrom specifies a source path to a YAML file whose contents are
	// exported in the ExternalArtifact .status.exportedInputs field.
	// The format is "@<alias>/<path>", where <alias> references a source or
	// "artifact" for the generated artifact itself. When pathPattern is set,
	// the path may use capture placeholders such as "{module}".
	// +kubebuilder:validation:Pattern="^@([a-z0-9]([a-z0-9_-]*[a-z0-9])?)/(.*)$"
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=1024
	// +optional
	InputsFrom string `json:"inputsFrom,omitempty"`

	// Revision is the revision of the generated artifact.
	// If specified, it must point to an existing source alias in the format "@<alias>".
	// If not specified, the revision is automatically set to the digest of the artifact content.
	// +kubebuilder:validation:Pattern="^@([a-z0-9]([a-z0-9_-]*[a-z0-9])?)$"
	// +kubebuilder:validation:MaxLength=64
	// +optional
	Revision string `json:"revision,omitempty"`

	// OriginRevision is used to set the 'org.opencontainers.image.revision'
	// annotation on the generated artifact metadata.
	// If specified, it must point to an existing source alias in the format "@<alias>".
	// If the referenced source has an origin revision (e.g. a Git commit SHA),
	// it will be used to set the annotation on the generated artifact.
	// If the referenced source does not have an origin revision, the field is ignored.
	// +kubebuilder:validation:Pattern="^@([a-z0-9]([a-z0-9_-]*[a-z0-9])?)$"
	// +kubebuilder:validation:MaxLength=64
	// +optional
	OriginRevision string `json:"originRevision,omitempty"`

	// Copy defines a list of copy operations to perform from the sources to the generated artifact.
	// The copy operations are performed in the order they are listed with existing files
	// being overwritten by later copy operations.
	// +kubebuilder:validation:MinItems=1
	// +required
	Copy []CopyOperation `json:"copy"`
}

OutputArtifact defines the desired state of an ExternalArtifact generated by the ArtifactGenerator.

func (*OutputArtifact) DeepCopy

func (in *OutputArtifact) DeepCopy() *OutputArtifact

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

func (*OutputArtifact) DeepCopyInto

func (in *OutputArtifact) DeepCopyInto(out *OutputArtifact)

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

type SourceReference

type SourceReference struct {
	// Alias of the source within the ArtifactGenerator context.
	// The alias must be unique per ArtifactGenerator, and must consist
	// of lower case alphanumeric characters, underscores, and hyphens.
	// It must start and end with an alphanumeric character.
	// +kubebuilder:validation:Pattern="^[a-z0-9]([a-z0-9_-]*[a-z0-9])?$"
	// +kubebuilder:validation:MaxLength=63
	// +required
	Alias string `json:"alias"`

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

	// Namespace of the source.
	// If not provided, defaults to the same namespace as the ArtifactGenerator.
	// +kubebuilder:validation:Pattern="^[a-z0-9]([-a-z0-9]*[a-z0-9])?$"
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +optional
	Namespace string `json:"namespace,omitempty"`

	// Kind of the source.
	// +kubebuilder:validation:Enum=Bucket;GitRepository;OCIRepository;HelmChart;ExternalArtifact
	// +required
	Kind string `json:"kind"`
}

SourceReference contains the reference to a Flux source-controller resource.

func (*SourceReference) DeepCopy

func (in *SourceReference) DeepCopy() *SourceReference

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

func (*SourceReference) DeepCopyInto

func (in *SourceReference) DeepCopyInto(out *SourceReference)

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