Skip to content

Commit

Permalink
Rejigger flags around environment
Browse files Browse the repository at this point in the history
  • Loading branch information
John Daniel Maguire committed Apr 27, 2022
1 parent 96cb9ec commit 1977fae
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ module "cloud-manager-agent" {

namespace = var.cma_namespace
settings = var.cma_settings
environment = var.environment
environment = var.cma_environment
values = var.cma_values
}

Expand Down
2 changes: 1 addition & 1 deletion modules/cloud-manager-agent/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ locals {
settings = var.settings != null ? var.settings : {}
timeout = var.timeout != null ? var.timeout : 120
values = var.values != null ? var.values : []
environment = var.environment
environment = var.environment != null ? var.environment : "production"
}

resource "helm_release" "cloud-manager-agent" {
Expand Down
2 changes: 1 addition & 1 deletion modules/cloud-manager-agent/values.yaml.tftpl
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@ appConfig:
applicationAgentProperties:
kubernetesExternalSecret:
enabled: true
secretName: cloud-manager-agent-extra-%{environment}
secretName: cloud-manager-agent-extra-${environment}
4 changes: 2 additions & 2 deletions modules/cloud-manager-agent/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@ variable "environment" {
description = "Whether this is for a test, staging, or production environment."

validation {
condition = var.stage == "test" || var.stage == "staging" || var.stage == "production"
error_message = "Got an unexpected value for environment (expecting test, staging, or production)"
condition = var.environment == "test" || var.environment == "staging" || var.environment == "production"
error_message = "Got an unexpected value for environment (expecting test, staging, or production)."
}
}

Expand Down
4 changes: 2 additions & 2 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -870,7 +870,7 @@ variable "cma_environment" {
description = "Whether this is for a test, staging, or production environment."

validation {
condition = var.stage == "test" || var.stage == "staging" || var.stage == "production"
error_message = "Got an unexpected value for environment (expecting test, staging, or production)"
condition = var.cma_environment == "test" || var.cma_environment == "staging" || var.cma_environment == "production"
error_message = "Got an unexpected value for environment (expecting test, staging, or production)."
}
}

0 comments on commit 1977fae

Please sign in to comment.