v1alpha1

package
v0.4.0 Latest Latest
Warning

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

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

Documentation

Overview

Package v1 contains API Schema definitions for the kustomize.toolkit.fluxcd.io v1 API group. +kubebuilder:object:generate=true +groupName=krm.kcl.dev.fluxcd

Package v1alpha1 contains API Schema definitions for the krm.kcl.dev.fluxcd v1alpha1 API group +kubebuilder:object:generate=true +groupName=krm.kcl.dev.fluxcd

Index

Constants

View Source
const (
	KCLRunKind                = "KCLRun"
	KCLRunFinalizer           = "finalizers.fluxcd.io"
	MaxConditionMessageLength = 20000
	EnabledValue              = "enabled"
	DisabledValue             = "disabled"
	MergeValue                = "Merge"
	IfNotPresentValue         = "IfNotPresent"
	IgnoreValue               = "Ignore"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "krm.kcl.dev.fluxcd", Version: "v1alpha1"}

	// 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 CommonMetadata added in v0.4.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.

type ConfigSpec added in v0.4.0

type ConfigSpec struct {
	// Arguments is the list of top level dynamic arguments for the kcl option function, e.g., env="prod"
	// +optional
	Arguments []string `json:"arguments,omitempty" yaml:"arguments,omitempty"`
	// Settings is the list of kcl setting files including all of the CLI config.
	// +optional
	Settings []string `json:"settings,omitempty" yaml:"settings,omitempty"`
	// Overrides is the list of override paths and values, e.g., app.image="v2"
	// +optional
	Overrides []string `json:"overrides,omitempty" yaml:"overrides,omitempty"`
	// PathSelectors is the list of path selectors to select output result, e.g., a.b.c
	// +optional
	PathSelectors []string `json:"pathSelectors,omitempty" yaml:"pathSelectors,omitempty"`
	// Vendor denotes running kcl in the vendor mode.
	// +optional
	Vendor bool `json:"vendor,omitempty" yaml:"vendor,omitempty"`
	// SortKeys denotes sorting the output result keys, e.g., `{b = 1, a = 2} => {a = 2, b = 1}`.
	// +optional
	SortKeys bool `json:"sortKeys,omitempty" yaml:"sortKeys,omitempty"`
	// ShowHidden denotes output the hidden attribute in the result.
	// +optional
	ShowHidden bool `json:"showHidden,omitempty" yaml:"showHidden,omitempty"`
	// DisableNone denotes running kcl and disable dumping None values.
	// +optional
	DisableNone bool `json:"disableNone,omitempty" yaml:"disableNone,omitempty"`
}

ConfigSpec defines the compile config.

type KCLRun

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

	Spec   KCLRunSpec   `json:"spec,omitempty"`
	Status KCLRunStatus `json:"status,omitempty"`
}

KCLRun is the Schema for the kclruns API

func (*KCLRun) DeepCopy

func (in *KCLRun) DeepCopy() *KCLRun

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

func (*KCLRun) DeepCopyInto

func (in *KCLRun) DeepCopyInto(out *KCLRun)

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

func (*KCLRun) DeepCopyObject

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

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

func (KCLRun) GetConditions

func (in KCLRun) GetConditions() []metav1.Condition

GetConditions returns the status conditions of the object.

func (KCLRun) GetDependsOn added in v0.4.0

func (in KCLRun) GetDependsOn() []meta.NamespacedObjectReference

GetDependsOn returns the list of dependencies across-namespaces.

func (KCLRun) GetReleaseNamespace

func (in KCLRun) GetReleaseNamespace() string

GetReleaseNamespace returns the configured TargetNamespace, or the namespace of the KCLRun.

func (KCLRun) GetRequeueAfter added in v0.4.0

func (in KCLRun) GetRequeueAfter() time.Duration

GetRequeueAfter returns the duration after which the KCLRun must be reconciled again.

func (KCLRun) GetRetryInterval added in v0.4.0

func (in KCLRun) GetRetryInterval() time.Duration

GetRetryInterval returns the retry interval

func (KCLRun) GetTimeout

func (in KCLRun) GetTimeout() time.Duration

GetTimeout returns the configured Timeout, or the default of 300s.

func (KCLRun) SetConditions

func (in KCLRun) SetConditions(conditions []metav1.Condition)

SetConditions sets the status conditions on the object.

func (KCLRun) UsePersistentClient

func (in KCLRun) UsePersistentClient() bool

UsePersistentClient returns the configured PersistentClient, or the default of true.

type KCLRunList

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

KCLRunList contains a list of KCLRun

func (*KCLRunList) DeepCopy

func (in *KCLRunList) DeepCopy() *KCLRunList

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

func (*KCLRunList) DeepCopyInto

func (in *KCLRunList) DeepCopyInto(out *KCLRunList)

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

func (*KCLRunList) DeepCopyObject

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

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

type KCLRunSpec

type KCLRunSpec 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"`

	// 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"`

	// Timeout is the time to wait for any individual Kubernetes operation (like Jobs
	// for hooks) during the performance. Defaults to '5m0s'.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// PersistentClient tells the controller to use a persistent Kubernetes
	// client for this release. When enabled, the client will be reused for the
	// duration of the reconciliation, instead of being created and destroyed
	// for each (step of a).
	//
	// If not set, it defaults to true.
	//
	// +optional
	PersistentClient *bool `json:"persistentClient,omitempty"`

	// The KubeConfig for reconciling the controller on a remote cluster.
	// When used in combination with `KCLRunSpec.ServiceAccountName`,
	// forces the controller to act on behalf of that Service Account at the
	// target cluster.
	// If the --default-service-account flag is set, its value will be used as
	// a controller level fallback for when `KCLRunSpec.ServiceAccountName`
	// is empty.
	// +optional
	KubeConfig *meta.KubeConfigReference `json:"kubeConfig,omitempty"`

	// The name of the Kubernetes service account to impersonate
	// when reconciling this KCL source.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=253
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// TargetNamespace to target when performing operations for the KCL.
	// Defaults to the namespace of the KCL source.
	// +kubebuilder:validation:MinLength=1
	// +kubebuilder:validation:MaxLength=63
	// +kubebuilder:validation:Optional
	// +optional
	TargetNamespace string `json:"targetNamespace,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"`

	// The interval at which to reconcile the KCL Module.
	// This interval is approximate and may be subject to jitter to ensure
	// efficient use of resources.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
	// +required
	Interval metav1.Duration `json:"interval"`

	// The interval at which to retry a previously failed reconciliation.
	// When not specified, the controller uses the KCLRunSpec.Interval
	// value to retry failures.
	// +kubebuilder:validation:Type=string
	// +kubebuilder:validation:Pattern="^([0-9]+(\\.[0-9]+)?(ms|s|m|h))+$"
	// +optional
	RetryInterval *metav1.Duration `json:"retryInterval,omitempty"`

	// Path to the directory containing the kcl.mod file.
	// Defaults to 'None', which translates to the root path of the SourceRef.
	// +optional
	Path string `json:"path,omitempty"`

	// Params are the parameters in key-value pairs format.
	// +optional
	Params map[string]runtime.RawExtension `json:"params,omitempty" yaml:"params,omitempty"`

	// Config is the KCL compile config.
	// +optional
	Config *ConfigSpec `json:"config,omitempty" yaml:"config,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"`

	// Wait instructs the controller to check the health of all the reconciled
	// resources. When enabled, the HealthChecks are ignored. Defaults to false.
	// +optional
	Wait bool `json:"wait,omitempty"`

	// Reference of the source where the kcl file is.
	// +required
	SourceRef kc.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"`
}

KCLRunSpec defines the desired state of KCLRun

func (*KCLRunSpec) DeepCopy

func (in *KCLRunSpec) DeepCopy() *KCLRunSpec

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

func (*KCLRunSpec) DeepCopyInto

func (in *KCLRunSpec) DeepCopyInto(out *KCLRunSpec)

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

type KCLRunStatus

type KCLRunStatus struct {
	meta.ReconcileRequestStatus `json:",inline"`

	// ObservedGeneration is the last reconciled generation.
	// +optional
	ObservedGeneration int64 `json:"observedGeneration,omitempty"`

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

	// The last successfully applied revision.
	// Equals the Revision of the applied Artifact from the referenced Source.
	// +optional
	LastAppliedRevision string `json:"lastAppliedRevision,omitempty"`

	// LastAttemptedRevision is the revision of the last reconciliation attempt.
	// +optional
	LastAttemptedRevision string `json:"lastAttemptedRevision,omitempty"`

	// LastAttemptedRevisionDigest is the digest of the last reconciliation attempt.
	// This is only set for OCIRepository sources.
	// +optional
	LastAttemptedRevisionDigest string `json:"lastAttemptedRevisionDigest,omitempty"`

	// Inventory contains the list of Kubernetes resource object references that
	// have been successfully applied.
	// +optional
	Inventory *ResourceInventory `json:"inventory,omitempty"`
}

KCLRunStatus defines the observed state of KCLRun

func (*KCLRunStatus) DeepCopy

func (in *KCLRunStatus) DeepCopy() *KCLRunStatus

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

func (*KCLRunStatus) DeepCopyInto

func (in *KCLRunStatus) DeepCopyInto(out *KCLRunStatus)

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

type ResourceInventory added in v0.4.0

type ResourceInventory struct {
	// Entries of Kubernetes resource object references.
	Entries []ResourceRef `json:"entries"`
}

ResourceInventory contains a list of Kubernetes resource object references that have been applied by a Kustomization.

func (*ResourceInventory) DeepCopy added in v0.4.0

func (in *ResourceInventory) DeepCopy() *ResourceInventory

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

func (*ResourceInventory) DeepCopyInto added in v0.4.0

func (in *ResourceInventory) DeepCopyInto(out *ResourceInventory)

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

type ResourceRef added in v0.4.0

type ResourceRef struct {
	// ID is the string representation of the Kubernetes resource object's metadata,
	// in the format '<namespace>_<name>_<group>_<kind>'.
	ID string `json:"id"`

	// Version is the API version of the Kubernetes resource object's kind.
	Version string `json:"v"`
}

ResourceRef contains the information necessary to locate a resource within a cluster.

func (*ResourceRef) DeepCopy added in v0.4.0

func (in *ResourceRef) DeepCopy() *ResourceRef

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

func (*ResourceRef) DeepCopyInto added in v0.4.0

func (in *ResourceRef) DeepCopyInto(out *ResourceRef)

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