Documentation
¶
Overview ¶
+kubebuilder:object:generate=true +groupName=infra.contrib.fluxcd.io
Package v1alpha2 contains API Schema definitions for the infra v1alpha2 API group +kubebuilder:object:generate=true +groupName=infra.contrib.fluxcd.io
Index ¶
- Constants
- Variables
- func SetTerraformReadiness(terraform *Terraform, status metav1.ConditionStatus, reason, message string, ...)
- type BackendConfigSpec
- type BackendConfigsReference
- type BranchPlanner
- type CloudSpec
- type CloudWorkspacesSpec
- type CrossNamespaceSourceReference
- type FileMapping
- type ForceUnlockEnum
- type HealthCheck
- type LockStatus
- type PlanStatus
- type ReadInputsFromSecretSpec
- type Remediation
- type ResourceInventory
- type ResourceRef
- type RunnerPodMetadata
- type RunnerPodSpec
- type RunnerPodTemplate
- type TFStateSpec
- type Terraform
- func TerraformApplied(terraform Terraform, revision string, message string, isDestroyApply bool, ...) Terraform
- func TerraformAppliedFailResetPlanAndNotReady(terraform Terraform, revision, reason, message string) Terraform
- func TerraformApplying(terraform Terraform, revision string, message string) Terraform
- func TerraformDriftDetected(terraform Terraform, revision, reason, message string) Terraform
- func TerraformForceUnlock(terraform Terraform, message string) Terraform
- func TerraformHealthCheckFailed(terraform Terraform, message string) Terraform
- func TerraformHealthCheckSucceeded(terraform Terraform, message string) Terraform
- func TerraformNoDrift(terraform Terraform, revision, reason, message string) Terraform
- func TerraformNotReady(terraform Terraform, revision, reason, message string) Terraform
- func TerraformOutputsAvailable(terraform Terraform, availableOutputs []string, message string) Terraform
- func TerraformOutputsWritten(terraform Terraform, revision string, message string) Terraform
- func TerraformPlannedNoChanges(terraform Terraform, revision string, message string) Terraform
- func TerraformPlannedWithChanges(terraform Terraform, revision string, forceOrAutoApply bool, message string) Terraform
- func TerraformPostPlanningWebhookFailed(terraform Terraform, revision string, message string) Terraform
- func TerraformProgressing(terraform Terraform, message string) Terraform
- func TerraformReachedLimit(terraform Terraform) Terraform
- func TerraformResetRetry(terraform Terraform) Terraform
- func TerraformStateLocked(terraform Terraform, lockID, message string) Terraform
- func (in *Terraform) DeepCopy() *Terraform
- func (in *Terraform) DeepCopyInto(out *Terraform)
- func (in *Terraform) DeepCopyObject() runtime.Object
- func (in *Terraform) FromBytes(b []byte, scheme *runtime.Scheme) error
- func (in Terraform) GetConditions() []metav1.Condition
- func (in Terraform) GetDependsOn() []meta.NamespacedObjectReference
- func (in *Terraform) GetReconciliationFailures() int64
- func (in *Terraform) GetRetries() int64
- func (in Terraform) GetRetryInterval() time.Duration
- func (in *Terraform) GetRunnerHostname(target string, clusterDomain string) string
- func (in *Terraform) GetStatusConditions() *[]metav1.Condition
- func (in Terraform) HasDrift() bool
- func (in *Terraform) IncrementReconciliationFailures()
- func (in *Terraform) ShouldRetry() bool
- func (in Terraform) ToBytes(scheme *runtime.Scheme) ([]byte, error)
- func (in *Terraform) WorkspaceName() string
- type TerraformList
- type TerraformSpec
- type TerraformStatus
- type Variable
- type VarsReference
- type Webhook
- type WriteOutputsToSecretSpec
Constants ¶
const ( HealthCheckTypeTCP = "tcp" HealthCheckTypeHttpGet = "http" )
const ( CACertSecretName = "tf-controller.tls" // RunnerTLSSecretName is the name of the secret containing a TLS cert that will be written to // the namespace in which a terraform runner is created RunnerTLSSecretName = "terraform-runner.tls" RunnerLabel = "infra.contrib.fluxcd.io/terraform" GitRepositoryIndexKey = ".metadata.gitRepository" BucketIndexKey = ".metadata.bucket" OCIRepositoryIndexKey = ".metadata.ociRepository" BreakTheGlassAnnotation = "break-the-glass.tf-controller/requestedAt" )
const ( TerraformKind = "Terraform" TerraformFinalizer = "finalizers.tf.contrib.fluxcd.io" MaxConditionMessageLength = 20000 DisabledValue = "disabled" ApprovePlanAutoValue = "auto" ApprovePlanDisableValue = "disable" DefaultWorkspaceName = "default" )
const ( AccessDeniedReason = "AccessDenied" ArtifactFailedReason = "ArtifactFailed" RetryLimitReachedReason = "RetryLimitReached" DeletionBlockedByDependants = "DeletionBlockedByDependantsReason" DependencyNotReadyReason = "DependencyNotReady" DriftDetectedReason = "DriftDetected" DriftDetectionFailedReason = "DriftDetectionFailed" HealthChecksFailedReason = "HealthChecksFailed" NoDriftReason = "NoDrift" OutputsWritingFailedReason = "OutputsWritingFailed" PlannedNoChangesReason = "TerraformPlannedNoChanges" PlannedWithChangesReason = "TerraformPlannedWithChanges" PostPlanningWebhookFailedReason = "PostPlanningWebhookFailed" TFExecApplyFailedReason = "TFExecApplyFailed" TFExecApplySucceedReason = "TerraformAppliedSucceed" TFExecForceUnlockReason = "ForceUnlock" TFExecInitFailedReason = "TFExecInitFailed" TFExecLockHeldReason = "LockHeld" TFExecNewFailedReason = "TFExecNewFailed" TFExecOutputFailedReason = "TFExecOutputFailed" TFExecPlanFailedReason = "TFExecPlanFailed" TemplateGenerationFailedReason = "TemplateGenerationFailed" VarsGenerationFailedReason = "VarsGenerationFailed" WorkspaceSelectFailedReason = "SelectWorkspaceFailed" )
The potential reasons that are associated with condition types
const ( ConditionTypeApply = "Apply" ConditionTypeHealthCheck = "HealthCheck" ConditionTypeOutput = "Output" ConditionTypePlan = "Plan" ConditionTypeStateLocked = "StateLocked" )
These constants are the Condition Types that the Terraform Resource works with
const (
PostPlanningWebhook = "post-planning"
)
Webhook stages
const (
TFDependencyOfPrefix = "tf.dependency.of."
)
Variables ¶
var ( // GroupVersion is group version used to register these objects GroupVersion = schema.GroupVersion{Group: "infra.contrib.fluxcd.io", Version: "v1alpha2"} // 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 SetTerraformReadiness ¶
func SetTerraformReadiness(terraform *Terraform, status metav1.ConditionStatus, reason, message string, revision string)
SetTerraformReadiness sets the ReadyCondition, ObservedGeneration, and LastAttemptedRevision, on the Terraform.
Types ¶
type BackendConfigSpec ¶
type BackendConfigSpec struct { // Disable is to completely disable the backend configuration. // +optional Disable bool `json:"disable"` // +optional SecretSuffix string `json:"secretSuffix,omitempty"` // +optional InClusterConfig bool `json:"inClusterConfig,omitempty"` // +optional CustomConfiguration string `json:"customConfiguration,omitempty"` // +optional ConfigPath string `json:"configPath,omitempty"` // +optional Labels map[string]string `json:"labels,omitempty"` }
BackendConfigSpec is for specifying configuration for Terraform's Kubernetes backend
func (*BackendConfigSpec) DeepCopy ¶
func (in *BackendConfigSpec) DeepCopy() *BackendConfigSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendConfigSpec.
func (*BackendConfigSpec) DeepCopyInto ¶
func (in *BackendConfigSpec) DeepCopyInto(out *BackendConfigSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BackendConfigsReference ¶
type BackendConfigsReference struct { // Kind of the values referent, valid values are ('Secret', 'ConfigMap'). // +kubebuilder:validation:Enum=Secret;ConfigMap // +required Kind string `json:"kind"` // Name of the configs referent. Should reside in the same namespace as the // referring resource. // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 // +required Name string `json:"name"` // Keys is the data key where a specific value can be found at. Defaults to all keys. // +optional Keys []string `json:"keys,omitempty"` // Optional marks this BackendConfigsReference as optional. When set, a not found error // for the values reference is ignored, but any Key or // transient error will still result in a reconciliation failure. // +optional Optional bool `json:"optional,omitempty"` }
func (*BackendConfigsReference) DeepCopy ¶
func (in *BackendConfigsReference) DeepCopy() *BackendConfigsReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BackendConfigsReference.
func (*BackendConfigsReference) DeepCopyInto ¶
func (in *BackendConfigsReference) DeepCopyInto(out *BackendConfigsReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BranchPlanner ¶
type BranchPlanner struct { // EnablePathScope specifies if the Branch Planner should or shouldn't check // if a Pull Request has changes under `.spec.path`. If enabled extra // resources will be created only if there are any changes in terraform files. // +optional EnablePathScope bool `json:"enablePathScope"` }
func (*BranchPlanner) DeepCopy ¶
func (in *BranchPlanner) DeepCopy() *BranchPlanner
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BranchPlanner.
func (*BranchPlanner) DeepCopyInto ¶
func (in *BranchPlanner) DeepCopyInto(out *BranchPlanner)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CloudSpec ¶
type CloudSpec struct { // +required Organization string `json:"organization"` // +required Workspaces *CloudWorkspacesSpec `json:"workspaces"` // +optional Hostname string `json:"hostname,omitempty"` // +optional Token string `json:"token,omitempty"` }
func (*CloudSpec) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudSpec.
func (*CloudSpec) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CloudWorkspacesSpec ¶
type CloudWorkspacesSpec struct { // +optional Name string `json:"name"` // +optional Tags []string `json:"tags,omitempty"` }
func (*CloudWorkspacesSpec) DeepCopy ¶
func (in *CloudWorkspacesSpec) DeepCopy() *CloudWorkspacesSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CloudWorkspacesSpec.
func (*CloudWorkspacesSpec) DeepCopyInto ¶
func (in *CloudWorkspacesSpec) DeepCopyInto(out *CloudWorkspacesSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
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;OCIRepository // +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"` }
CrossNamespaceSourceReference contains enough information to let you locate the typed Kubernetes resource object at cluster level.
func (*CrossNamespaceSourceReference) DeepCopy ¶
func (in *CrossNamespaceSourceReference) DeepCopy() *CrossNamespaceSourceReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CrossNamespaceSourceReference.
func (*CrossNamespaceSourceReference) DeepCopyInto ¶
func (in *CrossNamespaceSourceReference) DeepCopyInto(out *CrossNamespaceSourceReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*CrossNamespaceSourceReference) String ¶
func (s *CrossNamespaceSourceReference) String() string
type FileMapping ¶
type FileMapping struct { // Reference to a Secret that contains the file content SecretRef meta.SecretKeyReference `json:"secretRef"` // Location can be either user's home directory or the Terraform workspace // +kubebuilder:validation:Enum=home;workspace // +required Location string `json:"location"` // Path of the file - relative to the "location" // +kubebuilder:validation:Pattern=`^(.?[/_a-zA-Z0-9]{1,})*$` // +required Path string `json:"path"` }
func (*FileMapping) DeepCopy ¶
func (in *FileMapping) DeepCopy() *FileMapping
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new FileMapping.
func (*FileMapping) DeepCopyInto ¶
func (in *FileMapping) DeepCopyInto(out *FileMapping)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ForceUnlockEnum ¶
type ForceUnlockEnum string
const ( ForceUnlockEnumAuto ForceUnlockEnum = "auto" ForceUnlockEnumYes ForceUnlockEnum = "yes" ForceUnlockEnumNo ForceUnlockEnum = "no" )
type HealthCheck ¶
type HealthCheck struct { // Name of the health check. // +kubebuilder:validation:MinLength=1 // +kubebuilder:validation:MaxLength=253 // +required Name string `json:"name"` // Type of the health check, valid values are ('tcp', 'http'). // If tcp is specified, address is required. // If http is specified, url is required. // +kubebuilder:validation:Enum=tcp;http // +required Type string `json:"type"` // URL to perform http health check on. Required when http type is specified. // Go template can be used to reference values from the terraform output // (e.g. https://example.org, {{.output_url}}). // +optional URL string `json:"url,omitempty"` // Address to perform tcp health check on. Required when tcp type is specified. // Go template can be used to reference values from the terraform output // (e.g. 127.0.0.1:8080, {{.address}}:{{.port}}). // +optional Address string `json:"address,omitempty"` // The timeout period at which the connection should timeout if unable to // complete the request. // When not specified, default 20s timeout is used. // +kubebuilder:default="20s" // +optional Timeout *metav1.Duration `json:"timeout,omitempty"` }
HealthCheck contains configuration needed to perform a health check after terraform is applied.
func (*HealthCheck) DeepCopy ¶
func (in *HealthCheck) DeepCopy() *HealthCheck
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthCheck.
func (*HealthCheck) DeepCopyInto ¶
func (in *HealthCheck) DeepCopyInto(out *HealthCheck)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (HealthCheck) GetTimeout ¶
func (in HealthCheck) GetTimeout() time.Duration
type LockStatus ¶
type LockStatus struct { // +optional LastApplied string `json:"lastApplied,omitempty"` // Pending holds the identifier of the Lock Holder to be used with Force Unlock // +optional Pending string `json:"pending,omitempty"` }
LockStatus defines the observed state of a Terraform State Lock
func (*LockStatus) DeepCopy ¶
func (in *LockStatus) DeepCopy() *LockStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new LockStatus.
func (*LockStatus) DeepCopyInto ¶
func (in *LockStatus) DeepCopyInto(out *LockStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PlanStatus ¶
type PlanStatus struct { // +optional LastApplied string `json:"lastApplied,omitempty"` // +optional Pending string `json:"pending,omitempty"` // +optional IsDestroyPlan bool `json:"isDestroyPlan,omitempty"` // +optional IsDriftDetectionPlan bool `json:"isDriftDetectionPlan,omitempty"` }
func (*PlanStatus) DeepCopy ¶
func (in *PlanStatus) DeepCopy() *PlanStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PlanStatus.
func (*PlanStatus) DeepCopyInto ¶
func (in *PlanStatus) DeepCopyInto(out *PlanStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ReadInputsFromSecretSpec ¶
type ReadInputsFromSecretSpec struct { // +required Name string `json:"name"` // +required As string `json:"as"` }
func (*ReadInputsFromSecretSpec) DeepCopy ¶
func (in *ReadInputsFromSecretSpec) DeepCopy() *ReadInputsFromSecretSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ReadInputsFromSecretSpec.
func (*ReadInputsFromSecretSpec) DeepCopyInto ¶
func (in *ReadInputsFromSecretSpec) DeepCopyInto(out *ReadInputsFromSecretSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Remediation ¶
type Remediation struct { // Retries is the number of retries that should be attempted on failures // before bailing. Defaults to '0', a negative integer denotes unlimited // retries. // +optional Retries int64 `json:"retries,omitempty"` }
func (*Remediation) DeepCopy ¶
func (in *Remediation) DeepCopy() *Remediation
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Remediation.
func (*Remediation) DeepCopyInto ¶
func (in *Remediation) DeepCopyInto(out *Remediation)
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 { // Terraform resource's name. Name string `json:"n"` // Type is Terraform resource's type Type string `json:"t"` // ID is the resource identifier. This is cloud-specific. For example, ARN is an ID on AWS. Identifier string `json:"id"` }
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 RunnerPodMetadata ¶
type RunnerPodMetadata struct { // Labels to add to the runner pod // +optional Labels map[string]string `json:"labels,omitempty"` // Annotations to add to the runner pod // +optional Annotations map[string]string `json:"annotations,omitempty"` }
func (*RunnerPodMetadata) DeepCopy ¶
func (in *RunnerPodMetadata) DeepCopy() *RunnerPodMetadata
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunnerPodMetadata.
func (*RunnerPodMetadata) DeepCopyInto ¶
func (in *RunnerPodMetadata) DeepCopyInto(out *RunnerPodMetadata)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RunnerPodSpec ¶
type RunnerPodSpec struct { // Runner pod image to use other than default // +optional Image string `json:"image,omitempty"` // List of sources to populate environment variables in the container. // The keys defined within a source must be a C_IDENTIFIER. All invalid keys // will be reported as an event when the container is starting. When a key exists in multiple // sources, the value associated with the last source will take precedence. // Values defined by an Env with a duplicate key will take precedence. // Cannot be updated. // +optional EnvFrom []corev1.EnvFromSource `json:"envFrom,omitempty"` // List of environment variables to set in the container. // Cannot be updated. // +optional // +patchMergeKey=name // +patchStrategy=merge Env []corev1.EnvVar `json:"env,omitempty" patchStrategy:"merge" patchMergeKey:"name"` // Set the NodeSelector for the Runner Pod // +optional NodeSelector map[string]string `json:"nodeSelector,omitempty"` // Set the Affinity for the Runner Pod // +optional Affinity *corev1.Affinity `json:"affinity,omitempty"` // Set the Tolerations for the Runner Pod // +optional Tolerations []corev1.Toleration `json:"tolerations,omitempty"` // Set Volume Mounts for the Runner Pod // +optional VolumeMounts []corev1.VolumeMount `json:"volumeMounts,omitempty"` // Set Volumes for the Runner Pod // +optional Volumes []corev1.Volume `json:"volumes,omitempty"` // Set up Init Containers for the Runner // +optional InitContainers []corev1.Container `json:"initContainers,omitempty"` // Set host aliases for the Runner Pod // +optional HostAliases []corev1.HostAlias `json:"hostAliases,omitempty"` // Set PriorityClassName for the Runner Pod container // +optional PriorityClassName string `json:"priorityClassName,omitempty"` // Set SecurityContext for the Runner Pod container // +optional SecurityContext *corev1.SecurityContext `json:"securityContext,omitempty"` // Set Resources for the Runner Pod container // +optional Resources *corev1.ResourceRequirements `json:"resources,omitempty"` }
func (*RunnerPodSpec) DeepCopy ¶
func (in *RunnerPodSpec) DeepCopy() *RunnerPodSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunnerPodSpec.
func (*RunnerPodSpec) DeepCopyInto ¶
func (in *RunnerPodSpec) DeepCopyInto(out *RunnerPodSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RunnerPodTemplate ¶
type RunnerPodTemplate struct { // +optional Metadata RunnerPodMetadata `json:"metadata,omitempty"` // +optional Spec RunnerPodSpec `json:"spec,omitempty"` }
func (*RunnerPodTemplate) DeepCopy ¶
func (in *RunnerPodTemplate) DeepCopy() *RunnerPodTemplate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RunnerPodTemplate.
func (*RunnerPodTemplate) DeepCopyInto ¶
func (in *RunnerPodTemplate) DeepCopyInto(out *RunnerPodTemplate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TFStateSpec ¶
type TFStateSpec struct { // ForceUnlock a Terraform state if it has become locked for any reason. Defaults to `no`. // // This is an Enum and has the expected values of: // // - auto // - yes // - no // // WARNING: Only use `auto` in the cases where you are absolutely certain that // no other system is using this state, you could otherwise end up in a bad place // See https://www.terraform.io/language/state/locking#force-unlock for more // information on the terraform state lock and force unlock. // // +optional // +kubebuilder:validation:Enum:=yes;no;auto // +kubebuilder:default:string=no ForceUnlock ForceUnlockEnum `json:"forceUnlock,omitempty"` // LockIdentifier holds the Identifier required by Terraform to unlock the state // if it ever gets into a locked state. // // You'll need to put the Lock Identifier in here while setting ForceUnlock to // either `yes` or `auto`. // // Leave this empty to do nothing, set this to the value of the `Lock Info: ID: [value]`, // e.g. `f2ab685b-f84d-ac0b-a125-378a22877e8d`, to force unlock the state. // // +optional LockIdentifier string `json:"lockIdentifier,omitempty"` // LockTimeout is a Duration string that instructs Terraform to retry acquiring a lock for the specified period of // time before returning an error. The duration syntax is a number followed by a time unit letter, such as `3s` for // three seconds. // // Defaults to `0s` which will behave as though `LockTimeout` was not set // // +optional // +kubebuilder:default:string="0s" LockTimeout metav1.Duration `json:"lockTimeout,omitempty"` }
TFStateSpec allows the user to set ForceUnlock
func (*TFStateSpec) DeepCopy ¶
func (in *TFStateSpec) DeepCopy() *TFStateSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TFStateSpec.
func (*TFStateSpec) DeepCopyInto ¶
func (in *TFStateSpec) DeepCopyInto(out *TFStateSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Terraform ¶
type Terraform struct { metav1.TypeMeta `json:",inline"` metav1.ObjectMeta `json:"metadata,omitempty"` Spec TerraformSpec `json:"spec,omitempty"` // +kubebuilder:default={"observedGeneration":-1} Status TerraformStatus `json:"status,omitempty"` }
Terraform is the Schema for the terraforms API
func TerraformApplied ¶
func TerraformApplying ¶
func TerraformDriftDetected ¶
func TerraformForceUnlock ¶
TerraformForceUnlock will set a new condition on the Terraform resource indicating that we are attempting to force unlock it.
func TerraformNoDrift ¶
func TerraformNotReady ¶
TerraformNotReady registers a failed apply attempt of the given Terraform.
func TerraformOutputsWritten ¶
func TerraformProgressing ¶
TerraformProgressing resets the conditions of the given Terraform to a single ReadyCondition with status ConditionUnknown.
func TerraformReachedLimit ¶
TerraformReachedLimit will set a new condition on the Terraform resource indicating that the resource has reached its retry limit.
func TerraformResetRetry ¶
TerraformResetRetry will set a new condition on the Terraform resource indicating that the resource retry count has been reset.
func TerraformStateLocked ¶
TerraformStateLocked will set a new condition on the Terraform resource indicating that the resource has been locked.
func (*Terraform) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Terraform.
func (*Terraform) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Terraform) DeepCopyObject ¶
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
func (Terraform) GetConditions ¶
GetConditions returns a pointer to the Status.Conditions slice. pretty much the same as GetStatusConditions but to comply with flux conditions.Getter interface it needs to return a copy of the conditions slice
func (Terraform) GetDependsOn ¶
func (in Terraform) GetDependsOn() []meta.NamespacedObjectReference
GetDependsOn returns the list of dependencies, namespace scoped.
func (*Terraform) GetReconciliationFailures ¶
func (*Terraform) GetRetries ¶
func (Terraform) GetRetryInterval ¶
GetRetryInterval returns the retry interval
func (*Terraform) GetRunnerHostname ¶
func (*Terraform) GetStatusConditions ¶
GetStatusConditions returns a pointer to the Status.Conditions slice.
func (Terraform) HasDrift ¶
HasDrift returns true if drift has been detected since the last successful apply
func (*Terraform) IncrementReconciliationFailures ¶
func (in *Terraform) IncrementReconciliationFailures()
func (*Terraform) ShouldRetry ¶
func (*Terraform) WorkspaceName ¶
type TerraformList ¶
type TerraformList struct { metav1.TypeMeta `json:",inline"` metav1.ListMeta `json:"metadata,omitempty"` Items []Terraform `json:"items"` }
TerraformList contains a list of Terraform
func (*TerraformList) DeepCopy ¶
func (in *TerraformList) DeepCopy() *TerraformList
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TerraformList.
func (*TerraformList) DeepCopyInto ¶
func (in *TerraformList) DeepCopyInto(out *TerraformList)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TerraformList) DeepCopyObject ¶
func (in *TerraformList) DeepCopyObject() runtime.Object
DeepCopyObject is an autogenerated deepcopy function, copying the receiver, creating a new runtime.Object.
type TerraformSpec ¶
type TerraformSpec struct { // ApprovePlan specifies name of a plan wanted to approve. // If its value is "auto", the controller will automatically approve every plan. // +optional ApprovePlan string `json:"approvePlan,omitempty"` // Destroy produces a destroy plan. Applying the plan will destroy all resources. // +optional Destroy bool `json:"destroy,omitempty"` // +optional BackendConfig *BackendConfigSpec `json:"backendConfig,omitempty"` // +optional BackendConfigsFrom []BackendConfigsReference `json:"backendConfigsFrom,omitempty"` // +optional Cloud *CloudSpec `json:"cloud,omitempty"` // +optional // +kubebuilder:default:=default Workspace string `json:"workspace,omitempty"` // List of input variables to set for the Terraform program. // +optional Vars []Variable `json:"vars,omitempty"` // List of references to a Secret or a ConfigMap to generate variables for // Terraform resources based on its data, selectively by varsKey. Values of the later // Secret / ConfigMap with the same keys will override those of the former. // +optional VarsFrom []VarsReference `json:"varsFrom,omitempty"` // Values map to the Terraform variable "values", which is an object of arbitrary values. // It is a convenient way to pass values to Terraform resources without having to define // a variable for each value. To use this feature, your Terraform file must define the variable "values". // +optional Values *apiextensionsv1.JSON `json:"values,omitempty"` // TfVarsFiles loads all given .tfvars files. It copycats the -var-file functionality. // +optional TfVarsFiles []string `json:"tfVarsFiles,omitempty"` // List of all configuration files to be created in initialization. // +optional FileMappings []FileMapping `json:"fileMappings,omitempty"` // The interval at which to reconcile the Terraform. // +required Interval metav1.Duration `json:"interval"` // The interval at which to retry a previously failed reconciliation. // The default value is 15 when not specified. // +optional RetryInterval *metav1.Duration `json:"retryInterval,omitempty"` // Path to the directory containing Terraform (.tf) files. // Defaults to 'None', which translates to the root path of the SourceRef. // +optional Path string `json:"path,omitempty"` // SourceRef is the reference of the source where the Terraform files are stored. // +required SourceRef CrossNamespaceSourceReference `json:"sourceRef"` // Suspend is to tell the controller to suspend subsequent TF executions, // it does not apply to already started executions. Defaults to false. // +optional Suspend bool `json:"suspend,omitempty"` // Force instructs the controller to unconditionally // re-plan and re-apply TF resources. Defaults to false. // +kubebuilder:default:=false // +optional Force bool `json:"force,omitempty"` // +optional ReadInputsFromSecrets []ReadInputsFromSecretSpec `json:"readInputsFromSecrets,omitempty"` // A list of target secrets for the outputs to be written as. // +optional WriteOutputsToSecret *WriteOutputsToSecretSpec `json:"writeOutputsToSecret,omitempty"` // Disable automatic drift detection. Drift detection may be resource intensive in // the context of a large cluster or complex Terraform statefile. Defaults to false. // +kubebuilder:default:=false // +optional DisableDriftDetection bool `json:"disableDriftDetection,omitempty"` // +optional CliConfigSecretRef *corev1.SecretReference `json:"cliConfigSecretRef,omitempty"` // List of health checks to be performed. // +optional HealthChecks []HealthCheck `json:"healthChecks,omitempty"` // Create destroy plan and apply it to destroy terraform resources // upon deletion of this object. Defaults to false. // +kubebuilder:default:=false // +optional DestroyResourcesOnDeletion bool `json:"destroyResourcesOnDeletion,omitempty"` // Name of a ServiceAccount for the runner Pod to provision Terraform resources. // Default to tf-runner. // +kubebuilder:default:=tf-runner // +optional ServiceAccountName string `json:"serviceAccountName,omitempty"` // Clean the runner pod up after each reconciliation cycle // +kubebuilder:default:=true // +optional AlwaysCleanupRunnerPod *bool `json:"alwaysCleanupRunnerPod,omitempty"` // Configure the termination grace period for the runner pod. Use this parameter // to allow the Terraform process to gracefully shutdown. Consider increasing for // large, complex or slow-moving Terraform managed resources. // +kubebuilder:default:=30 // +optional RunnerTerminationGracePeriodSeconds *int64 `json:"runnerTerminationGracePeriodSeconds,omitempty"` // RefreshBeforeApply forces refreshing of the state before the apply step. // +kubebuilder:default:=false // +optional RefreshBeforeApply bool `json:"refreshBeforeApply,omitempty"` // +optional RunnerPodTemplate RunnerPodTemplate `json:"runnerPodTemplate,omitempty"` // EnableInventory enables the object to store resource entries as the inventory for external use. // +optional EnableInventory bool `json:"enableInventory,omitempty"` // +optional TFState *TFStateSpec `json:"tfstate,omitempty"` // Targets specify the resource, module or collection of resources to target. // +optional Targets []string `json:"targets,omitempty"` // Parallelism limits the number of concurrent operations of Terraform apply step. Zero (0) means using the default value. // +kubebuilder:default:=0 // +optional Parallelism int32 `json:"parallelism,omitempty"` // StoreReadablePlan enables storing the plan in a readable format. // +kubebuilder:validation:Enum=none;json;human // +kubebuilder:default:=none // +optional StoreReadablePlan string `json:"storeReadablePlan,omitempty"` // +optional Webhooks []Webhook `json:"webhooks,omitempty"` // +optional DependsOn []meta.NamespacedObjectReference `json:"dependsOn,omitempty"` // Enterprise is the enterprise configuration placeholder. // +optional Enterprise *apiextensionsv1.JSON `json:"enterprise,omitempty"` // PlanOnly specifies if the reconciliation should or should not stop at plan // phase. // +optional PlanOnly bool `json:"planOnly,omitempty"` // BreakTheGlass specifies if the reconciliation should stop // and allow interactive shell in case of emergency. // +optional BreakTheGlass bool `json:"breakTheGlass,omitempty"` // BranchPlanner configuration. // +optional BranchPlanner *BranchPlanner `json:"branchPlanner,omitempty"` // Remediation specifies what the controller should do when reconciliation // fails. The default is to not perform any action. // +optional Remediation *Remediation `json:"remediation,omitempty"` }
TerraformSpec defines the desired state of Terraform
func (*TerraformSpec) DeepCopy ¶
func (in *TerraformSpec) DeepCopy() *TerraformSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TerraformSpec.
func (*TerraformSpec) DeepCopyInto ¶
func (in *TerraformSpec) DeepCopyInto(out *TerraformSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*TerraformSpec) GetAlwaysCleanupRunnerPod ¶
func (in *TerraformSpec) GetAlwaysCleanupRunnerPod() bool
type TerraformStatus ¶
type TerraformStatus 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"` // LastPlannedRevision is the revision used by the last planning process. // The result could be either no plan change or a new plan generated. // +optional LastPlannedRevision string `json:"lastPlannedRevision,omitempty"` // LastPlanAt is the time when the last terraform plan was performed // +optional LastPlanAt *metav1.Time `json:"lastPlanAt,omitempty"` // LastDriftDetectedAt is the time when the last drift was detected // +optional LastDriftDetectedAt *metav1.Time `json:"lastDriftDetectedAt,omitempty"` // LastAppliedByDriftDetectionAt is the time when the last drift was detected and // terraform apply was performed as a result // +optional LastAppliedByDriftDetectionAt *metav1.Time `json:"lastAppliedByDriftDetectionAt,omitempty"` // +optional AvailableOutputs []string `json:"availableOutputs,omitempty"` // +optional Plan PlanStatus `json:"plan,omitempty"` // Inventory contains the list of Terraform resource object references that have been successfully applied. // +optional Inventory *ResourceInventory `json:"inventory,omitempty"` // +optional Lock LockStatus `json:"lock,omitempty"` // ReconciliationFailures is the number of reconciliation // failures since the last success or update. // +optional ReconciliationFailures int64 `json:"reconciliationFailures,omitempty"` }
TerraformStatus defines the observed state of Terraform
func (*TerraformStatus) DeepCopy ¶
func (in *TerraformStatus) DeepCopy() *TerraformStatus
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new TerraformStatus.
func (*TerraformStatus) DeepCopyInto ¶
func (in *TerraformStatus) DeepCopyInto(out *TerraformStatus)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Variable ¶
type Variable struct { // Name is the name of the variable // +required Name string `json:"name"` // +optional Value *apiextensionsv1.JSON `json:"value,omitempty"` // +optional ValueFrom *corev1.EnvVarSource `json:"valueFrom,omitempty"` }
func (*Variable) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Variable.
func (*Variable) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type VarsReference ¶
type VarsReference 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"` // VarsKeys is the data key at which a specific value can be found. Defaults to all keys. // +optional VarsKeys []string `json:"varsKeys,omitempty"` // Optional marks this VarsReference as optional. When set, a not found error // for the values reference is ignored, but any VarsKey or // transient error will still result in a reconciliation failure. // +optional Optional bool `json:"optional,omitempty"` }
VarsReference contain a reference of a Secret or a ConfigMap to generate variables for Terraform resources based on its data, selectively by varsKey.
func (*VarsReference) DeepCopy ¶
func (in *VarsReference) DeepCopy() *VarsReference
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new VarsReference.
func (*VarsReference) DeepCopyInto ¶
func (in *VarsReference) DeepCopyInto(out *VarsReference)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Webhook ¶
type Webhook struct { // +kubebuilder:validation:Enum=post-planning // +kubebuilder:default:=post-planning // +required Stage string `json:"stage"` // +kubebuilder:default:=true // +optional Enabled *bool `json:"enabled,omitempty"` // +required URL string `json:"url"` // +kubebuilder:value:Enum=SpecAndPlan,SpecOnly,PlanOnly // +kubebuilder:default:=SpecAndPlan // +optional PayloadType string `json:"payloadType,omitempty"` // +optional ErrorMessageTemplate string `json:"errorMessageTemplate,omitempty"` // +required TestExpression string `json:"testExpression,omitempty"` }
func (*Webhook) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Webhook.
func (*Webhook) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type WriteOutputsToSecretSpec ¶
type WriteOutputsToSecretSpec struct { // Name is the name of the Secret to be written // +required Name string `json:"name"` // Labels to add to the outputted secret // +optional Labels map[string]string `json:"labels,omitempty"` // Annotations to add to the outputted secret // +optional Annotations map[string]string `json:"annotations,omitempty"` // Outputs contain the selected names of outputs to be written // to the secret. Empty array means writing all outputs, which is default. // +optional Outputs []string `json:"outputs,omitempty"` }
WriteOutputsToSecretSpec defines where to store outputs, and which outputs to be stored.
func (*WriteOutputsToSecretSpec) DeepCopy ¶
func (in *WriteOutputsToSecretSpec) DeepCopy() *WriteOutputsToSecretSpec
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WriteOutputsToSecretSpec.
func (*WriteOutputsToSecretSpec) DeepCopyInto ¶
func (in *WriteOutputsToSecretSpec) DeepCopyInto(out *WriteOutputsToSecretSpec)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.