v1alpha1

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Feb 7, 2023 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package v1alpha1 contains API Schema definitions for the cue v1alpha1 API group +kubebuilder:object:generate=true +groupName=cue.contrib.flux.io

Package v1alpha1 contains API Schema definitions for the cue v1alpha1 API group +kubebuilder:object:generate=true +groupName=cue.contrib.flux.io

Index

Constants

View Source
const (
	// HealthyCondition represents the last recorded
	// health assessment result.
	HealthyCondition string = "Healthy"

	// ArtifactFailedReason represents the fact that the
	// source artifact download failed.
	ArtifactFailedReason string = "ArtifactFailed"

	// BuildFailedReason represents the fact that the
	// kustomize build failed.
	BuildFailedReason string = "BuildFailed"

	// GateFailedReason represents the fact that the
	// cue build failed.
	GateFailedReason string = "GateFailedReasonk"

	// PruneFailedReason represents the fact that the
	// pruning of the CueInstance failed.
	PruneFailedReason string = "PruneFailed"

	// HealthCheckFailedReason represents the fact that
	// one of the health checks failed.
	HealthCheckFailedReason string = "HealthCheckFailed"
)
View Source
const (
	CueInstanceKind           = "CueInstance"
	CueInstanceFinalizer      = "finalizers.fluxcd.io"
	MaxConditionMessageLength = 20000
	DisabledValue             = "disabled"
)

Variables

View Source
var (
	// GroupVersion is group version used to register these objects
	GroupVersion = schema.GroupVersion{Group: "cue.contrib.flux.io", 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

func SetCueInstanceHealthiness added in v0.2.0

func SetCueInstanceHealthiness(c *CueInstance, status metav1.ConditionStatus, reason, message string)

SetCueInstanceHealthiness sets the HealthyCondition status for a CueInstance.

func SetCueInstanceReadiness

func SetCueInstanceReadiness(c *CueInstance, status metav1.ConditionStatus, reason, message string, revision string)

SetCueInstanceReadiness sets the ReadyCondition, ObservedGeneration, and LastAttemptedRevision, on the CueInstance.

Types

type CrossNamespaceSourceReference

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 namespace of the Kubernetes resource object that contains the reference.
	// +optional
	Namespace string `json:"namespace,omitempty"`
}

func (*CrossNamespaceSourceReference) DeepCopy

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

func (*CrossNamespaceSourceReference) DeepCopyInto

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

func (*CrossNamespaceSourceReference) String

type CueInstance

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

	Spec   CueInstanceSpec   `json:"spec,omitempty"`
	Status CueInstanceStatus `json:"status,omitempty"`
}

CueInstance is the Schema for the cueinstances API

func CueInstanceNotReady

func CueInstanceNotReady(c CueInstance, revision, reason, message string) CueInstance

CueInstanceNotReady registers a failed apply attempt of the given CueInstance.

func CueInstanceNotReadyInventory

func CueInstanceNotReadyInventory(c CueInstance, inventory *ResourceInventory, revision, reason, message string) CueInstance

CueInstanceNotReadyInventory registers a failed apply attempt of the given CueInstance.

func CueInstanceProgressing

func CueInstanceProgressing(c CueInstance, message string) CueInstance

CueInstanceProgressing resets the conditions of the given CueInstance to a single ReadyCondition with status ConditionUnknown.

func CueInstanceReadyInventory

func CueInstanceReadyInventory(c CueInstance, inventory *ResourceInventory, revision, reason, message string) CueInstance

CueInstanceReadyInventory registers a successful apply attempt of the given CueInstance.

func (*CueInstance) DeepCopy

func (in *CueInstance) DeepCopy() *CueInstance

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

func (*CueInstance) DeepCopyInto

func (in *CueInstance) DeepCopyInto(out *CueInstance)

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

func (*CueInstance) DeepCopyObject

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

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

func (CueInstance) GetConditions added in v0.3.0

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

GetConditions returns the status conditions of the object.

func (CueInstance) GetDependsOn

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

GetDependsOn returns the list of dependencies across-namespaces.

func (CueInstance) GetRetryInterval

func (in CueInstance) GetRetryInterval() time.Duration

GetRetryInterval returns the retry interval

func (*CueInstance) GetStatusConditions

func (in *CueInstance) GetStatusConditions() *[]metav1.Condition

GetStatusConditions returns a pointer to the Status.Conditions slice.

func (CueInstance) GetTimeout

func (in CueInstance) GetTimeout() time.Duration

GetTimeout returns the timeout

func (*CueInstance) SetConditions added in v0.3.0

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

SetConditions sets the status conditions on the object.

type CueInstanceList

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

CueInstanceList contains a list of CueInstance

func (*CueInstanceList) DeepCopy

func (in *CueInstanceList) DeepCopy() *CueInstanceList

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

func (*CueInstanceList) DeepCopyInto

func (in *CueInstanceList) DeepCopyInto(out *CueInstanceList)

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

func (*CueInstanceList) DeepCopyObject

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

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

type CueInstanceSpec

type CueInstanceSpec struct {
	// The interval at which the instance will be reconciled.
	// +required
	Interval metav1.Duration `json:"interval"`

	// A reference to a Flux Source from which an artifact will be downloaded
	// and the CUE instance built.
	// +required
	SourceRef CrossNamespaceSourceReference `json:"sourceRef"`

	// The module root of the CUE instance.
	// +optional
	Root string `json:"root,omitempty"`

	// The path at which the CUE instance will be built from.
	// +optional
	Path string `json:"path,omitempty"`

	// The CUE package to use for the CUE instance. This is useful when applying
	// a CUE schema to plain yaml files.
	// +optional
	Package string `json:"package,omitempty"`

	// Tags that will be injected into the CUE instance.
	// +optional
	Tags []TagVar `json:"tags,omitempty"`

	// TagVars that will be available to the CUE instance.
	// +optional
	TagVars []TagVar `json:"tagVars,omitempty"`

	// The CUE expression(s) to execute.
	// +optional
	Exprs []string `json:"expressions,omitempty"`

	// A list of CUE expressions that must be true for the CUE instance to be
	// reconciled
	// +optional
	Gates []GateExpr `json:"gates,omitempty"`

	// Dependencies that must be ready before the CUE instance is reconciled.
	// +optional
	DependsOn []meta.NamespacedObjectReference `json:"dependsOn,omitempty"`

	// A list of resources to be included in the health assessment.
	// +optional
	HealthChecks []meta.NamespacedObjectKindReference `json:"healthChecks,omitempty"`

	// Prune enables garbage collection.
	// +required
	Prune bool `json:"prune"`

	// The interval at which to retry a previously failed reconciliation.
	// When not specified, the controller uses the CueInstanceSpec.Interval
	// value to retry failures.
	// +optional
	RetryInterval *metav1.Duration `json:"retryInterval,omitempty"`

	// Timeout for validation, apply and health checking operations.
	// Defaults to 'Interval' duration.
	// +optional
	Timeout *metav1.Duration `json:"timeout,omitempty"`

	// This flag tells the controller to suspend subsequent cue executions,
	// it does not apply to already started executions. Defaults to false.
	// +optional
	Suspend bool `json:"suspend,omitempty"`

	// The name of the Kubernetes service account to impersonate
	// when reconciling this CueInstance.
	// +optional
	ServiceAccountName string `json:"serviceAccountName,omitempty"`

	// The KubeConfig for reconciling the CueInstance on a remote cluster.
	// When specified, KubeConfig takes precedence over ServiceAccountName.
	// +optional
	KubeConfig *KubeConfig `json:"kubeConfig,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"`

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

	// TODO(maybe): this could be an array of validations
	// in which case the policy may need to apply to all resources
	// would allow for greater flexibility
	// +optional
	Validate *Validation `json:"validate,omitempty"`
}

CueInstanceSpec defines the desired state of CueInstance

func (*CueInstanceSpec) DeepCopy

func (in *CueInstanceSpec) DeepCopy() *CueInstanceSpec

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

func (*CueInstanceSpec) DeepCopyInto

func (in *CueInstanceSpec) DeepCopyInto(out *CueInstanceSpec)

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

type CueInstanceStatus

type CueInstanceStatus 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.
	// 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"`

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

CueInstanceStatus defines the observed state of CueInstance

func (*CueInstanceStatus) DeepCopy

func (in *CueInstanceStatus) DeepCopy() *CueInstanceStatus

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

func (*CueInstanceStatus) DeepCopyInto

func (in *CueInstanceStatus) DeepCopyInto(out *CueInstanceStatus)

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

type GateExpr added in v0.3.0

type GateExpr struct {
	// The CUE expression to evaluate.
	// +required
	Expr string `json:"expr"`

	// The name of the gate.
	// +required
	Name string `json:"name"`
}

GateExpr defines a CUE expression that must be true for the CUE instance to be reconciled

func (*GateExpr) DeepCopy added in v0.3.0

func (in *GateExpr) DeepCopy() *GateExpr

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

func (*GateExpr) DeepCopyInto added in v0.3.0

func (in *GateExpr) DeepCopyInto(out *GateExpr)

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

type KubeConfig

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 CueInstance.
	// 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 CueInstance.
	// +required
	SecretRef meta.LocalObjectReference `json:"secretRef,omitempty"`
}

KubeConfig references a Kubernetes secret that contains a kubeconfig file.

func (*KubeConfig) DeepCopy

func (in *KubeConfig) DeepCopy() *KubeConfig

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

func (*KubeConfig) DeepCopyInto

func (in *KubeConfig) DeepCopyInto(out *KubeConfig)

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

type ResourceInventory

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

func (in *ResourceInventory) DeepCopy() *ResourceInventory

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

func (*ResourceInventory) DeepCopyInto

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

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

func (in *ResourceRef) DeepCopy() *ResourceRef

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

func (*ResourceRef) DeepCopyInto

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

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

type TagVar

type TagVar struct {
	// +required
	Name string `json:"name"`

	// +optional
	Value string `json:"value,omitempty"`
}

TagVar is a tag variable with a required name and optional value

func (*TagVar) DeepCopy

func (in *TagVar) DeepCopy() *TagVar

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

func (*TagVar) DeepCopyInto

func (in *TagVar) DeepCopyInto(out *TagVar)

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

type Validation

type Validation struct {
	// +kubebuilder:default:="Audit"
	// +optional
	Mode ValidationMode `json:"mode,omitempty"`

	// +required
	Schema string `json:"schema"`

	// +kubebuilder:default:="yaml"
	// +optional
	Type string `json:"type,omitempty"`
}

func (*Validation) DeepCopy

func (in *Validation) DeepCopy() *Validation

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

func (*Validation) DeepCopyInto

func (in *Validation) DeepCopyInto(out *Validation)

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

type ValidationMode

type ValidationMode string
const (
	// IgnorePolicy will ignore validation errors
	IgnorePolicy ValidationMode = "Ignore"
	// AuditPolicy will ignore validation failures and generate an event
	AuditPolicy ValidationMode = "Audit"
	// DropPolicy will drop objects which are invalid but continue to reconcile valid objects
	DropPolicy ValidationMode = "Drop"
	// FailPolicy will fail the entire reconcile if any validation errors are encountered
	FailPolicy ValidationMode = "Fail"
)

Jump to

Keyboard shortcuts

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