Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INFRA-35677: Update v2 workspace to handle spec.tags #332

Merged
merged 1 commit into from
Jun 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions charts/terraform-cloud/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ 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.7.0] - 2024-06-07
### Changed
- Update v2 workspace to configure `spec.tags`

### Removed
- Remove v2 workspace custom-extension annotations (will be handled by `spec.tags` and `spec.teamAccess`)

## [v1.6.0] - 2024-06-06
### Added
- Added IRSA tests for workspace-v2 (copied and adjust v1 version)
Expand Down
2 changes: 1 addition & 1 deletion charts/terraform-cloud/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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.6.0
version: 1.7.0

# 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
Expand Down
2 changes: 1 addition & 1 deletion charts/terraform-cloud/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# terraform-cloud

![Version: 1.6.0](https://img.shields.io/badge/Version-1.6.0-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.7.0](https://img.shields.io/badge/Version-1.7.0-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

Expand Down
7 changes: 6 additions & 1 deletion charts/terraform-cloud/templates/helpers/_workspace-v2.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ metadata:
app.kubernetes.io/name: {{ printf "%s-%s" ($instanceCfg.name | kebabcase) ($resourceType | kebabcase) | trunc 63 }}
annotations:
{{ include "mintel_common.commonAnnotations" $ | nindent 4 }}
{{ include "mintel_common.terraform_cloud.tfCloudOperatorExtentionAnnotations" $workspaceDict | nindent 4 }}
{{- if (eq $resourceType "irsa") }}
app.mintel.com/altManifestFileSuffix: "{{ $global.name }}-{{ $resourceType | kebabcase }}"
{{- else }}
Expand All @@ -47,6 +46,12 @@ spec:
key: token
sshKey:
name: "mintel-ssh"
tags:
- env:{{ $global.clusterEnv }}
- owner:{{ $global.owner | lower }}
- mod:{{ $resourceType }}
- allow-destroy:{{ (include "mintel_common.terraform_cloud.allow_destroy" $workspaceDict) }}
- kubernetes-managed
terraformVersion: {{ $tfVersion | default $global.terraform.terraformVersion | quote }}
{{- if (has $resourceType (list "irsa" "extraIAM" )) }}
runTriggers:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ IRSA created explicitly:
annotations:
app.mintel.com/altManifestFileSuffix: test-app-irsa
app.mintel.com/placeholder: placeholder
app.mintel.com/terraform-allow-destroy: "true"
app.mintel.com/terraform-cloud-tags: env:dev,owner:sre,mod:irsa
app.mintel.com/terraform-owner: sre
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "-20"
labels:
Expand Down Expand Up @@ -38,6 +35,12 @@ IRSA created explicitly:
runTriggers: null
sshKey:
name: mintel-ssh
tags:
- env:dev
- owner:sre
- mod:irsa
- allow-destroy:true
- kubernetes-managed
terraformVariables:
- hcl: false
name: aws_account_name
Expand Down Expand Up @@ -130,9 +133,6 @@ IRSA created for Dev S3 module workspace:
annotations:
app.mintel.com/altManifestFileSuffix: test-app-irsa
app.mintel.com/placeholder: placeholder
app.mintel.com/terraform-allow-destroy: "true"
app.mintel.com/terraform-cloud-tags: env:dev,owner:sre,mod:irsa
app.mintel.com/terraform-owner: sre
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "-20"
labels:
Expand Down Expand Up @@ -163,6 +163,12 @@ IRSA created for Dev S3 module workspace:
- name: dev-eu-west-1-cluster1-test-namespace-mntl-test-app-s3
sshKey:
name: mintel-ssh
tags:
- env:dev
- owner:sre
- mod:irsa
- allow-destroy:true
- kubernetes-managed
terraformVariables:
- hcl: false
name: aws_account_name
Expand Down Expand Up @@ -255,9 +261,6 @@ IRSA created with default (0) syncWave:
annotations:
app.mintel.com/altManifestFileSuffix: test-app-irsa
app.mintel.com/placeholder: placeholder
app.mintel.com/terraform-allow-destroy: "true"
app.mintel.com/terraform-cloud-tags: env:dev,owner:sre,mod:irsa
app.mintel.com/terraform-owner: sre
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "0"
labels:
Expand Down Expand Up @@ -287,6 +290,12 @@ IRSA created with default (0) syncWave:
runTriggers: null
sshKey:
name: mintel-ssh
tags:
- env:dev
- owner:sre
- mod:irsa
- allow-destroy:true
- kubernetes-managed
terraformVariables:
- hcl: false
name: aws_account_name
Expand Down Expand Up @@ -379,9 +388,6 @@ IRSA created with modified syncWave:
annotations:
app.mintel.com/altManifestFileSuffix: test-app-irsa
app.mintel.com/placeholder: placeholder
app.mintel.com/terraform-allow-destroy: "true"
app.mintel.com/terraform-cloud-tags: env:dev,owner:sre,mod:irsa
app.mintel.com/terraform-owner: sre
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "-100"
labels:
Expand Down Expand Up @@ -411,6 +417,12 @@ IRSA created with modified syncWave:
runTriggers: null
sshKey:
name: mintel-ssh
tags:
- env:dev
- owner:sre
- mod:irsa
- allow-destroy:true
- kubernetes-managed
terraformVariables:
- hcl: false
name: aws_account_name
Expand Down
27 changes: 18 additions & 9 deletions charts/terraform-cloud/tests/__snapshot__/module-v2_test.yaml.snap
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,6 @@ Test module defaults:
annotations:
app.mintel.com/altManifestFileSuffix: mntl-test-workspace-s3
app.mintel.com/placeholder: placeholder
app.mintel.com/terraform-allow-destroy: "true"
app.mintel.com/terraform-cloud-tags: env:dev,owner:sre,mod:s3
app.mintel.com/terraform-owner: sre
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "-40"
labels:
Expand All @@ -29,6 +26,12 @@ Test module defaults:
organization: Mintel
sshKey:
name: mintel-ssh
tags:
- env:dev
- owner:sre
- mod:s3
- allow-destroy:true
- kubernetes-managed
terraformVariables:
- hcl: false
name: aws_account_name
Expand Down Expand Up @@ -126,9 +129,6 @@ Test module overrides:
annotations:
app.mintel.com/altManifestFileSuffix: mntl-test-workspace-s3
app.mintel.com/placeholder: placeholder
app.mintel.com/terraform-allow-destroy: "true"
app.mintel.com/terraform-cloud-tags: env:dev,owner:sre,mod:s3
app.mintel.com/terraform-owner: sre
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "-40"
labels:
Expand All @@ -149,6 +149,12 @@ Test module overrides:
organization: Mintel
sshKey:
name: mintel-ssh
tags:
- env:dev
- owner:sre
- mod:s3
- allow-destroy:true
- kubernetes-managed
terraformVariables:
- hcl: false
name: aws_account_name
Expand Down Expand Up @@ -246,9 +252,6 @@ Test module restartedAt disabled:
annotations:
app.mintel.com/altManifestFileSuffix: mntl-test-workspace-s3
app.mintel.com/placeholder: placeholder
app.mintel.com/terraform-allow-destroy: "true"
app.mintel.com/terraform-cloud-tags: env:dev,owner:sre,mod:s3
app.mintel.com/terraform-owner: sre
argocd.argoproj.io/sync-options: SkipDryRunOnMissingResource=true
argocd.argoproj.io/sync-wave: "-40"
labels:
Expand All @@ -269,6 +272,12 @@ Test module restartedAt disabled:
organization: Mintel
sshKey:
name: mintel-ssh
tags:
- env:dev
- owner:sre
- mod:s3
- allow-destroy:true
- kubernetes-managed
terraformVariables:
- hcl: false
name: aws_account_name
Expand Down
Loading
Loading