From f1e092797e9ff5e33d63dd7e0dce65d16f2835d2 Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Thu, 3 Oct 2024 11:10:48 +0000 Subject: [PATCH 01/11] feat: OpenTofu support to helm chart --- charts/atlantis/Chart.yaml | 2 +- charts/atlantis/README.md | 1 + charts/atlantis/templates/statefulset.yaml | 4 ++++ charts/atlantis/values.schema.json | 4 ++++ charts/atlantis/values.yaml | 4 ++++ 5 files changed, 14 insertions(+), 1 deletion(-) diff --git a/charts/atlantis/Chart.yaml b/charts/atlantis/Chart.yaml index dd085f12..0d955edf 100644 --- a/charts/atlantis/Chart.yaml +++ b/charts/atlantis/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 # renovate: datasource=docker depName=ghcr.io/runatlantis/atlantis -appVersion: v0.29.0 +appVersion: v0.30.0 description: A Helm chart for Atlantis https://www.runatlantis.io name: atlantis version: 5.5.2 diff --git a/charts/atlantis/README.md b/charts/atlantis/README.md index 696fbd57..262a6562 100644 --- a/charts/atlantis/README.md +++ b/charts/atlantis/README.md @@ -91,6 +91,7 @@ extraManifests: | customPem | string | `""` | Allows to override the /etc/ssl/certs/ca-certificates.cer with your custom one. You have to create a secret with the specified name. | | dataStorage | string | `""` | DEPRECATED - Disk space available to check out repositories. Example: 5Gi. | | defaultTFVersion | string | `""` | Sets the default terraform version to be used in atlantis server. Check values.yaml for examples. | +| defaultTFVersion | string | `terraform` | Sets the default distribution to be used in atlantis server. Check values.yaml for examples. | | disableApply | bool | `false` | Disables running `atlantis apply` regardless of which flags are sent with it. | | disableApplyAll | bool | `false` | Disables running `atlantis apply` without any flags. | | disableRepoLocking | bool | `false` | Stops atlantis locking projects and or workspaces when running terraform. | diff --git a/charts/atlantis/templates/statefulset.yaml b/charts/atlantis/templates/statefulset.yaml index a7e52c3c..856fa161 100644 --- a/charts/atlantis/templates/statefulset.yaml +++ b/charts/atlantis/templates/statefulset.yaml @@ -307,6 +307,10 @@ spec: - name: ATLANTIS_DEFAULT_TF_VERSION value: {{ .Values.defaultTFVersion }} {{- end }} + {{- if .Values.defaultTFDistribution }} + - name: ATLANTIS_TF_DISTRIBUTION + value: {{ .Values.defaultTFDistribution }} + {{- end }} {{- if .Values.logLevel }} - name: ATLANTIS_LOG_LEVEL value: {{ .Values.logLevel | quote}} diff --git a/charts/atlantis/values.schema.json b/charts/atlantis/values.schema.json index ce3e7554..2cbd84d7 100644 --- a/charts/atlantis/values.schema.json +++ b/charts/atlantis/values.schema.json @@ -313,6 +313,10 @@ "type": "string", "description": "Default Terraform version to be used by atlantis server" }, + "defaultTFDistribution": { + "type": "string", + "description": "Default Atlantis distribution to be used by atlantis server. Either Opentufu or terraform" + }, "disableApply": { "type": "boolean", "description": "Disables running `atlantis apply` regardless of what options are specified", diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index 257d4219..ef2ecf2c 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -228,6 +228,9 @@ hideUnchangedPlanComments: false defaultTFVersion: "" # Example: "0.12.0". +### -- Sets which TF distribution to use. Can be set to terraform or opentofu. +defaultTFDistribution: terraform + # -- Disables running `atlantis apply` regardless of which flags are sent with it. disableApply: false @@ -240,6 +243,7 @@ disableRepoLocking: false # -- Use Diff Markdown Format for color coding diffs. enableDiffMarkdownFormat: false + # -- Optionally specify an username and a password for basic authentication. basicAuth: username: "" From 7de2e315a81a8d6095c290460d568b181699974c Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Thu, 3 Oct 2024 22:57:40 +0200 Subject: [PATCH 02/11] bump version to 5.6.0 --- charts/atlantis/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/atlantis/Chart.yaml b/charts/atlantis/Chart.yaml index 0d955edf..cdbeece9 100644 --- a/charts/atlantis/Chart.yaml +++ b/charts/atlantis/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v1 appVersion: v0.30.0 description: A Helm chart for Atlantis https://www.runatlantis.io name: atlantis -version: 5.5.2 +version: 5.6.0 keywords: - terraform home: https://www.runatlantis.io From 7bc7cd6a7ffa58916a45e13e84e354a2ab1cdd42 Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Thu, 3 Oct 2024 22:58:57 +0200 Subject: [PATCH 03/11] fix env_var name --- charts/atlantis/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/atlantis/README.md b/charts/atlantis/README.md index 262a6562..2e8e969c 100644 --- a/charts/atlantis/README.md +++ b/charts/atlantis/README.md @@ -91,7 +91,7 @@ extraManifests: | customPem | string | `""` | Allows to override the /etc/ssl/certs/ca-certificates.cer with your custom one. You have to create a secret with the specified name. | | dataStorage | string | `""` | DEPRECATED - Disk space available to check out repositories. Example: 5Gi. | | defaultTFVersion | string | `""` | Sets the default terraform version to be used in atlantis server. Check values.yaml for examples. | -| defaultTFVersion | string | `terraform` | Sets the default distribution to be used in atlantis server. Check values.yaml for examples. | +| defaultTFDistribution | string | `terraform` | Sets the default terraform distribution to use. Can be set to terraform or opentofu. | | disableApply | bool | `false` | Disables running `atlantis apply` regardless of which flags are sent with it. | | disableApplyAll | bool | `false` | Disables running `atlantis apply` without any flags. | | disableRepoLocking | bool | `false` | Stops atlantis locking projects and or workspaces when running terraform. | From 7abf110350ade62b98bf4fe30f35f4e86bbc486c Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Thu, 3 Oct 2024 22:59:54 +0200 Subject: [PATCH 04/11] fix comment on the new values --- charts/atlantis/values.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index ef2ecf2c..747306e3 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -228,7 +228,7 @@ hideUnchangedPlanComments: false defaultTFVersion: "" # Example: "0.12.0". -### -- Sets which TF distribution to use. Can be set to terraform or opentofu. +### -- Sets the default terraform distribution to use. Can be set to terraform or opentofu. defaultTFDistribution: terraform # -- Disables running `atlantis apply` regardless of which flags are sent with it. From e02a8a6c39bc5e6783fad05188d3bb583b23e24d Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Thu, 3 Oct 2024 23:01:41 +0200 Subject: [PATCH 05/11] remove extra line --- charts/atlantis/values.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index 747306e3..e0092bf0 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -243,7 +243,6 @@ disableRepoLocking: false # -- Use Diff Markdown Format for color coding diffs. enableDiffMarkdownFormat: false - # -- Optionally specify an username and a password for basic authentication. basicAuth: username: "" From 69e2d525e7cbf746defdb6eca49894430cfd31f2 Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Wed, 9 Oct 2024 12:34:23 +0000 Subject: [PATCH 06/11] add distribution default value in schema --- charts/atlantis/values.schema.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/charts/atlantis/values.schema.json b/charts/atlantis/values.schema.json index 2cbd84d7..c7f89bd9 100644 --- a/charts/atlantis/values.schema.json +++ b/charts/atlantis/values.schema.json @@ -315,7 +315,11 @@ }, "defaultTFDistribution": { "type": "string", - "description": "Default Atlantis distribution to be used by atlantis server. Either Opentufu or terraform" + "description": "Default Atlantis distribution to be used by atlantis server. Either Opentufu or terraform", + "enum": [ + "terraform", + "opentofu" + ] }, "disableApply": { "type": "boolean", From 19c44988b5de454934d547a79dd2e6e6366ec04c Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Wed, 9 Oct 2024 12:35:35 +0000 Subject: [PATCH 07/11] add distribution default value in the schema --- charts/atlantis/values.schema.json | 1 + 1 file changed, 1 insertion(+) diff --git a/charts/atlantis/values.schema.json b/charts/atlantis/values.schema.json index c7f89bd9..f0b8ec4f 100644 --- a/charts/atlantis/values.schema.json +++ b/charts/atlantis/values.schema.json @@ -316,6 +316,7 @@ "defaultTFDistribution": { "type": "string", "description": "Default Atlantis distribution to be used by atlantis server. Either Opentufu or terraform", + "default": "terraform", "enum": [ "terraform", "opentofu" From 16ffcc8259e935b9da33e8cc3e943ec939bc5eb2 Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Wed, 9 Oct 2024 18:06:55 +0200 Subject: [PATCH 08/11] fix typo Co-authored-by: Gabriel Martinez <19713226+GMartinez-Sisti@users.noreply.github.com> --- charts/atlantis/values.schema.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/charts/atlantis/values.schema.json b/charts/atlantis/values.schema.json index f0b8ec4f..d8bb275e 100644 --- a/charts/atlantis/values.schema.json +++ b/charts/atlantis/values.schema.json @@ -315,7 +315,7 @@ }, "defaultTFDistribution": { "type": "string", - "description": "Default Atlantis distribution to be used by atlantis server. Either Opentufu or terraform", + "description": "Default Atlantis distribution to be used by atlantis server. Either opentofu or terraform", "default": "terraform", "enum": [ "terraform", From 3351d28ba4a0305476e431a1f6695d74f449b6f1 Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Sat, 12 Oct 2024 17:47:46 +0000 Subject: [PATCH 09/11] Fix the ordering of the properties to pass the test --- charts/atlantis/README.md | 2 +- charts/atlantis/values.schema.json | 8 ++++---- charts/atlantis/values.yaml | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/charts/atlantis/README.md b/charts/atlantis/README.md index 5c0eb55c..792fae0f 100644 --- a/charts/atlantis/README.md +++ b/charts/atlantis/README.md @@ -90,8 +90,8 @@ extraManifests: | containerSecurityContext | object | `{}` | Check values.yaml for examples. | | customPem | string | `""` | Allows to override the /etc/ssl/certs/ca-certificates.cer with your custom one. You have to create a secret with the specified name. | | dataStorage | string | `""` | DEPRECATED - Disk space available to check out repositories. Example: 5Gi. | -| defaultTFVersion | string | `""` | Sets the default terraform version to be used in atlantis server. Check values.yaml for examples. | | defaultTFDistribution | string | `terraform` | Sets the default terraform distribution to use. Can be set to terraform or opentofu. | +| defaultTFVersion | string | `""` | Sets the default terraform version to be used in atlantis server. Check values.yaml for examples. | | disableApply | bool | `false` | Disables running `atlantis apply` regardless of which flags are sent with it. | | disableApplyAll | bool | `false` | Disables running `atlantis apply` without any flags. | | disableRepoLocking | bool | `false` | Stops atlantis locking projects and or workspaces when running terraform. | diff --git a/charts/atlantis/values.schema.json b/charts/atlantis/values.schema.json index d8bb275e..6a5caa21 100644 --- a/charts/atlantis/values.schema.json +++ b/charts/atlantis/values.schema.json @@ -309,10 +309,6 @@ "description": "Allow atlantis to hide no-changes plan comments", "default": false }, - "defaultTFVersion": { - "type": "string", - "description": "Default Terraform version to be used by atlantis server" - }, "defaultTFDistribution": { "type": "string", "description": "Default Atlantis distribution to be used by atlantis server. Either opentofu or terraform", @@ -322,6 +318,10 @@ "opentofu" ] }, + "defaultTFVersion": { + "type": "string", + "description": "Default Terraform version to be used by atlantis server" + }, "disableApply": { "type": "boolean", "description": "Disables running `atlantis apply` regardless of what options are specified", diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index d10522e6..a0e61064 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -223,14 +223,14 @@ hidePrevPlanComments: false # -- Enables atlantis to hide no-changes plan comments from the pull request. hideUnchangedPlanComments: false +### -- Sets the default terraform distribution to use. Can be set to terraform or opentofu. +defaultTFDistribution: terraform + # -- Sets the default terraform version to be used in atlantis server. # Check values.yaml for examples. defaultTFVersion: "" # Example: "0.12.0". -### -- Sets the default terraform distribution to use. Can be set to terraform or opentofu. -defaultTFDistribution: terraform - # -- Disables running `atlantis apply` regardless of which flags are sent with it. disableApply: false From 259241c41870add6aa62f8147e209e99ddba3c40 Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Sun, 13 Oct 2024 07:23:29 +0000 Subject: [PATCH 10/11] Fix test CI by updating values file --- charts/atlantis/Chart.yaml | 2 +- charts/atlantis/README.md | 2 +- charts/atlantis/values.yaml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/charts/atlantis/Chart.yaml b/charts/atlantis/Chart.yaml index 1a2c0ec5..81316299 100644 --- a/charts/atlantis/Chart.yaml +++ b/charts/atlantis/Chart.yaml @@ -3,7 +3,7 @@ apiVersion: v1 appVersion: v0.30.0 description: A Helm chart for Atlantis https://www.runatlantis.io name: atlantis -version: 5.6.0 +version: 5.7.0 keywords: - terraform home: https://www.runatlantis.io diff --git a/charts/atlantis/README.md b/charts/atlantis/README.md index 792fae0f..36667512 100644 --- a/charts/atlantis/README.md +++ b/charts/atlantis/README.md @@ -90,7 +90,7 @@ extraManifests: | containerSecurityContext | object | `{}` | Check values.yaml for examples. | | customPem | string | `""` | Allows to override the /etc/ssl/certs/ca-certificates.cer with your custom one. You have to create a secret with the specified name. | | dataStorage | string | `""` | DEPRECATED - Disk space available to check out repositories. Example: 5Gi. | -| defaultTFDistribution | string | `terraform` | Sets the default terraform distribution to use. Can be set to terraform or opentofu. | +| defaultTFDistribution | string | `"terraform"` | Sets the default terraform distribution to use. Can be set to terraform or opentofu. | | defaultTFVersion | string | `""` | Sets the default terraform version to be used in atlantis server. Check values.yaml for examples. | | disableApply | bool | `false` | Disables running `atlantis apply` regardless of which flags are sent with it. | | disableApplyAll | bool | `false` | Disables running `atlantis apply` without any flags. | diff --git a/charts/atlantis/values.yaml b/charts/atlantis/values.yaml index a0e61064..df2c9308 100644 --- a/charts/atlantis/values.yaml +++ b/charts/atlantis/values.yaml @@ -223,7 +223,7 @@ hidePrevPlanComments: false # -- Enables atlantis to hide no-changes plan comments from the pull request. hideUnchangedPlanComments: false -### -- Sets the default terraform distribution to use. Can be set to terraform or opentofu. +# -- Sets the default terraform distribution to use. Can be set to terraform or opentofu. defaultTFDistribution: terraform # -- Sets the default terraform version to be used in atlantis server. From 8cbc5d62eae1309d15014dedcd566af6c76d2917 Mon Sep 17 00:00:00 2001 From: saifeddine Rajhi Date: Sun, 13 Oct 2024 09:56:27 +0000 Subject: [PATCH 11/11] Update tests to support ATLANTIS_TF_DISTRIBUTION env --- charts/atlantis/tests/statefulset_test.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/charts/atlantis/tests/statefulset_test.yaml b/charts/atlantis/tests/statefulset_test.yaml index f97a2529..c59f215d 100644 --- a/charts/atlantis/tests/statefulset_test.yaml +++ b/charts/atlantis/tests/statefulset_test.yaml @@ -119,6 +119,8 @@ tests: value: - name: PATH value: /plugins:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: ATLANTIS_TF_DISTRIBUTION + value: terraform - name: ATLANTIS_DATA_DIR value: /atlantis-data - name: ATLANTIS_REPO_ALLOWLIST @@ -184,6 +186,8 @@ tests: value: - name: PATH value: /plugins:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: ATLANTIS_TF_DISTRIBUTION + value: terraform - name: ATLANTIS_DATA_DIR value: /atlantis-data - name: ATLANTIS_REPO_ALLOWLIST @@ -993,6 +997,8 @@ tests: value: - name: PATH value: /foo:/bar:/plugins:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: ATLANTIS_TF_DISTRIBUTION + value: terraform - name: ATLANTIS_DATA_DIR value: /atlantis-data - name: ATLANTIS_REPO_ALLOWLIST @@ -1011,6 +1017,8 @@ tests: value: - name: PATH value: /home/atlantis:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: ATLANTIS_TF_DISTRIBUTION + value: terraform - name: ATLANTIS_DATA_DIR value: /atlantis-data - name: ATLANTIS_REPO_ALLOWLIST @@ -1030,6 +1038,8 @@ tests: value: - name: PATH value: /foo:/bar:/home/atlantis:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + - name: ATLANTIS_TF_DISTRIBUTION + value: terraform - name: ATLANTIS_DATA_DIR value: /atlantis-data - name: ATLANTIS_REPO_ALLOWLIST