From e4ec67d26fffd9c9ca847c7ad90110371daa3196 Mon Sep 17 00:00:00 2001 From: spoukke Date: Thu, 9 Feb 2023 12:39:02 +0100 Subject: [PATCH] feat: add remediation strategy in api --- api/v1alpha1/terraformlayer_types.go | 1 + api/v1alpha1/terraformrepository_types.go | 12 ++++++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/api/v1alpha1/terraformlayer_types.go b/api/v1alpha1/terraformlayer_types.go index df83d47d..0b09f8cb 100644 --- a/api/v1alpha1/terraformlayer_types.go +++ b/api/v1alpha1/terraformlayer_types.go @@ -40,6 +40,7 @@ type TerraformLayerSpec struct { type TerraformLayerRemediationStrategy struct { PlanOnDrift bool `json:"planOnDrift,omitempty"` ApplyOnDrift bool `json:"applyOnDrift,omitempty"` + PlanOnPush bool `json:"planOnPush,omitempty"` ApplyOnPush bool `json:"applyOnPush,omitempty"` } diff --git a/api/v1alpha1/terraformrepository_types.go b/api/v1alpha1/terraformrepository_types.go index f1367c0b..ed65ce59 100644 --- a/api/v1alpha1/terraformrepository_types.go +++ b/api/v1alpha1/terraformrepository_types.go @@ -28,8 +28,9 @@ type TerraformRepositorySpec struct { // INSERT ADDITIONAL SPEC FIELDS - desired state of cluster // Important: Run "make" to regenerate code after modifying this file - Repository TerraformRepositoryRepository `json:"repository,omitempty"` - OverrideRunnerSpec OverrideRunnerSpec `json:"overrideRunnerSpec,omitempty"` + Repository TerraformRepositoryRepository `json:"repository,omitempty"` + RemediationStrategy TerraformRepositoryRemediationStrategy `json:"remediationStrategy,omitempty"` + OverrideRunnerSpec OverrideRunnerSpec `json:"overrideRunnerSpec,omitempty"` } type TerraformRepositoryRepository struct { @@ -42,6 +43,13 @@ type TerraformRepositoryStatus struct { Conditions []metav1.Condition `json:"conditions,omitempty" patchStrategy:"merge" patchMergeKey:"type" protobuf:"bytes,1,rep,name=conditions"` } +type TerraformRepositoryRemediationStrategy struct { + PlanOnDrift bool `json:"planOnDrift,omitempty"` + ApplyOnDrift bool `json:"applyOnDrift,omitempty"` + PlanOnPush bool `json:"planOnPush,omitempty"` + ApplyOnPush bool `json:"applyOnPush,omitempty"` +} + //+kubebuilder:object:root=true //+kubebuilder:subresource:status