From 82c88be273310717f6dc594f2a64f0fdf936d13d Mon Sep 17 00:00:00 2001 From: Nick Date: Mon, 17 Jun 2024 12:43:27 +0100 Subject: [PATCH] INFRA-35342: Fix handling of `workspaceNameOverride` when `operatorVersion: "migrate"` used --- charts/terraform-cloud/CHANGELOG.md | 4 ++++ charts/terraform-cloud/Chart.yaml | 2 +- charts/terraform-cloud/README.md | 2 +- .../templates/helpers/_workspace-v1.yaml | 20 +++++++++---------- 4 files changed, 16 insertions(+), 12 deletions(-) diff --git a/charts/terraform-cloud/CHANGELOG.md b/charts/terraform-cloud/CHANGELOG.md index 7078d2ef..19cc44e3 100644 --- a/charts/terraform-cloud/CHANGELOG.md +++ b/charts/terraform-cloud/CHANGELOG.md @@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [v1.8.2] - 2024-06-17 +### Fixed +- Fix handling of `workspaceNameOverride` when `operatorVersion: "migrate"` used + ## [v1.8.1] - 2024-06-10 ### Fixed - Fix handling of `workspaceNameOverride` - was being unset prior to rendering of Module diff --git a/charts/terraform-cloud/Chart.yaml b/charts/terraform-cloud/Chart.yaml index d94e1455..78642333 100644 --- a/charts/terraform-cloud/Chart.yaml +++ b/charts/terraform-cloud/Chart.yaml @@ -15,7 +15,7 @@ type: application # This is the chart version. This version number should be incremented each time you make changes # to the chart and its templates, including the app version. # Versions are expected to follow Semantic Versioning (https://semver.org/) -version: 1.8.1 +version: 1.8.2 # This is the version number of the application being deployed. This version number should be # incremented each time you make changes to the application. Versions are not expected to diff --git a/charts/terraform-cloud/README.md b/charts/terraform-cloud/README.md index 0c1d76a1..06870b89 100644 --- a/charts/terraform-cloud/README.md +++ b/charts/terraform-cloud/README.md @@ -1,6 +1,6 @@ # terraform-cloud -![Version: 1.8.1](https://img.shields.io/badge/Version-1.8.1-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.0](https://img.shields.io/badge/AppVersion-2.0.0-informational?style=flat-square) +![Version: 1.8.2](https://img.shields.io/badge/Version-1.8.2-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 2.0.0](https://img.shields.io/badge/AppVersion-2.0.0-informational?style=flat-square) A Helm chart for provisioning resources using Terraform Cloud diff --git a/charts/terraform-cloud/templates/helpers/_workspace-v1.yaml b/charts/terraform-cloud/templates/helpers/_workspace-v1.yaml index af569128..fbbdf229 100644 --- a/charts/terraform-cloud/templates/helpers/_workspace-v1.yaml +++ b/charts/terraform-cloud/templates/helpers/_workspace-v1.yaml @@ -48,16 +48,16 @@ spec: {{ include "mintel_common.terraform_cloud.irsaRunTriggers" $| indent 4 }} {{- end }} variables: - {{- $_ := unset $instanceCfg "workspaceNameOverride" }} - {{- $_ := unset $instanceCfg "workspaceAllowDestroy" }} - {{- $_ := unset $instanceCfg "workspaceOwner" }} - {{- $_ := unset $instanceCfg "workspaceTags" }} - {{- $_ := unset $instanceCfg "outputSecretMap" }} - {{- $_ := unset $instanceCfg "syncWave" }} - {{- $_ := unset $instanceCfg "workspaceAllowDestroyPlan" }} - {{- $_ := unset $instanceCfg "workspaceApplyMethod" }} - {{- $_ := unset $instanceCfg "moduleDestroyOnDeletion" }} - {{- range $varKey, $varVal := $instanceCfg }} + {{- $instanceCfgCopyV1 := omit $instanceCfg "workspaceNameOverride" }} + {{- $instanceCfgCopyV1 = omit $instanceCfgCopyV1 "workspaceAllowDestroy" }} + {{- $instanceCfgCopyV1 = omit $instanceCfgCopyV1 "workspaceOwner" }} + {{- $instanceCfgCopyV1 = omit $instanceCfgCopyV1 "workspaceTags" }} + {{- $instanceCfgCopyV1 = omit $instanceCfgCopyV1 "outputSecretMap" }} + {{- $instanceCfgCopyV1 = omit $instanceCfgCopyV1 "syncWave" }} + {{- $instanceCfgCopyV1 = omit $instanceCfgCopyV1 "workspaceAllowDestroyPlan" }} + {{- $instanceCfgCopyV1 = omit $instanceCfgCopyV1 "workspaceApplyMethod" }} + {{- $instanceCfgCopyV1 = omit $instanceCfgCopyV1 "moduleDestroyOnDeletion" }} + {{- range $varKey, $varVal := $instanceCfgCopyV1 }} {{- if kindIs "map" $varVal }} {{- include "mintel_common.terraform_cloud.tfVar" (merge (dict "key" $varKey) $varVal) | indent 2 }} {{- else }}