From 6ae9f8d4eddfdb134bcbabd3f58e633757a6afc9 Mon Sep 17 00:00:00 2001 From: Rebecca Willett <47540675+rebwill@users.noreply.github.com> Date: Fri, 18 Aug 2023 12:04:55 -0400 Subject: [PATCH] Add `get_local_metadata` step back into `upgrade` scenario (#22419) --- enos/enos-scenario-replication.hcl | 12 ++++++------ enos/enos-scenario-smoke.hcl | 4 ++-- enos/enos-scenario-ui.hcl | 10 +++++----- enos/enos-scenario-upgrade.hcl | 11 ++++++++--- enos/enos-variables.hcl | 4 ++-- 5 files changed, 23 insertions(+), 18 deletions(-) diff --git a/enos/enos-scenario-replication.hcl b/enos/enos-scenario-replication.hcl index 0aae7af57834..bba7c9e9dc37 100644 --- a/enos/enos-scenario-replication.hcl +++ b/enos/enos-scenario-replication.hcl @@ -108,7 +108,7 @@ scenario "replication" { // This step reads the contents of the backend license if we're using a Consul backend and // the edition is "ent". step "read_backend_license" { - skip_step = (matrix.primary_backend == "raft" && matrix.secondary_backend == "raft") || var.backend_edition == "oss" + skip_step = (matrix.primary_backend == "raft" && matrix.secondary_backend == "raft") || var.backend_edition == "oss" module = module.read_license variables { @@ -231,7 +231,7 @@ scenario "replication" { variables { cluster_name = step.create_primary_cluster_backend_targets.cluster_name cluster_tag_key = local.backend_tag_key - license = (matrix.primary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + license = (matrix.primary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null release = { edition = var.backend_edition version = matrix.consul_version @@ -257,7 +257,7 @@ scenario "replication" { awskms_unseal_key_arn = step.create_vpc.kms_key_arn backend_cluster_name = step.create_primary_cluster_backend_targets.cluster_name backend_cluster_tag_key = local.backend_tag_key - consul_license = (matrix.primary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + consul_license = (matrix.primary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null cluster_name = step.create_primary_cluster_targets.cluster_name consul_release = matrix.primary_backend == "consul" ? { edition = var.backend_edition @@ -287,7 +287,7 @@ scenario "replication" { variables { cluster_name = step.create_secondary_cluster_backend_targets.cluster_name cluster_tag_key = local.backend_tag_key - license = (matrix.secondary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + license = (matrix.secondary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null release = { edition = var.backend_edition version = matrix.consul_version @@ -313,7 +313,7 @@ scenario "replication" { awskms_unseal_key_arn = step.create_vpc.kms_key_arn backend_cluster_name = step.create_secondary_cluster_backend_targets.cluster_name backend_cluster_tag_key = local.backend_tag_key - consul_license = (matrix.secondary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + consul_license = (matrix.secondary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null cluster_name = step.create_secondary_cluster_targets.cluster_name consul_release = matrix.secondary_backend == "consul" ? { edition = var.backend_edition @@ -555,7 +555,7 @@ scenario "replication" { backend_cluster_name = step.create_primary_cluster_backend_targets.cluster_name backend_cluster_tag_key = local.backend_tag_key cluster_name = step.create_primary_cluster_targets.cluster_name - consul_license = (matrix.primary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + consul_license = (matrix.primary_backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null consul_release = matrix.primary_backend == "consul" ? { edition = var.backend_edition version = matrix.consul_version diff --git a/enos/enos-scenario-smoke.hcl b/enos/enos-scenario-smoke.hcl index 755d931533d0..97a7d2713ebf 100644 --- a/enos/enos-scenario-smoke.hcl +++ b/enos/enos-scenario-smoke.hcl @@ -172,7 +172,7 @@ scenario "smoke" { variables { cluster_name = step.create_vault_cluster_backend_targets.cluster_name cluster_tag_key = local.backend_tag_key - license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null release = { edition = var.backend_edition version = matrix.consul_version @@ -199,7 +199,7 @@ scenario "smoke" { backend_cluster_name = step.create_vault_cluster_backend_targets.cluster_name backend_cluster_tag_key = local.backend_tag_key cluster_name = step.create_vault_cluster_targets.cluster_name - consul_license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + consul_license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null consul_release = matrix.backend == "consul" ? { edition = var.backend_edition version = matrix.consul_version diff --git a/enos/enos-scenario-ui.hcl b/enos/enos-scenario-ui.hcl index 4f179d3c4d35..d95b3ecdf0e9 100644 --- a/enos/enos-scenario-ui.hcl +++ b/enos/enos-scenario-ui.hcl @@ -15,10 +15,10 @@ scenario "ui" { ] locals { - arch = "amd64" - artifact_type = "bundle" + arch = "amd64" + artifact_type = "bundle" backend_license_path = abspath(var.backend_license_path != null ? var.backend_license_path : joinpath(path.root, "./support/consul.hclic")) - backend_tag_key = "VaultStorage" + backend_tag_key = "VaultStorage" build_tags = { "oss" = ["ui"] "ent" = ["ui", "enterprise", "ent"] @@ -139,7 +139,7 @@ scenario "ui" { variables { cluster_name = step.create_vault_cluster_backend_targets.cluster_name cluster_tag_key = local.backend_tag_key - license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null release = { edition = var.backend_edition version = local.consul_version @@ -165,7 +165,7 @@ scenario "ui" { backend_cluster_name = step.create_vault_cluster_backend_targets.cluster_name backend_cluster_tag_key = local.backend_tag_key cluster_name = step.create_vault_cluster_targets.cluster_name - consul_license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + consul_license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null consul_release = matrix.backend == "consul" ? { edition = var.backend_edition version = local.consul_version diff --git a/enos/enos-scenario-upgrade.hcl b/enos/enos-scenario-upgrade.hcl index 73e048f3a4b2..81b18bdb8f0d 100644 --- a/enos/enos-scenario-upgrade.hcl +++ b/enos/enos-scenario-upgrade.hcl @@ -29,7 +29,7 @@ scenario "upgrade" { locals { backend_license_path = abspath(var.backend_license_path != null ? var.backend_license_path : joinpath(path.root, "./support/consul.hclic")) - backend_tag_key = "VaultStorage" + backend_tag_key = "VaultStorage" build_tags = { "oss" = ["ui"] "ent" = ["ui", "enterprise", "ent"] @@ -61,6 +61,11 @@ scenario "upgrade" { vault_tag_key = "Type" // enos_vault_start expects Type as the tag key } + step "get_local_metadata" { + skip_step = matrix.artifact_source != "local" + module = module.get_local_metadata + } + # This step gets/builds the upgrade artifact that we will upgrade to step "build_vault" { module = "build_${matrix.artifact_source}" @@ -162,7 +167,7 @@ scenario "upgrade" { variables { cluster_name = step.create_vault_cluster_backend_targets.cluster_name cluster_tag_key = local.backend_tag_key - license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null release = { edition = var.backend_edition version = matrix.consul_version @@ -187,7 +192,7 @@ scenario "upgrade" { awskms_unseal_key_arn = step.create_vpc.kms_key_arn backend_cluster_name = step.create_vault_cluster_backend_targets.cluster_name backend_cluster_tag_key = local.backend_tag_key - consul_license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null + consul_license = (matrix.backend == "consul" && var.backend_edition == "ent") ? step.read_backend_license.license : null cluster_name = step.create_vault_cluster_targets.cluster_name consul_release = matrix.backend == "consul" ? { edition = var.backend_edition diff --git a/enos/enos-variables.hcl b/enos/enos-variables.hcl index f585ddd73b22..21c0a92f4a36 100644 --- a/enos/enos-variables.hcl +++ b/enos/enos-variables.hcl @@ -53,8 +53,8 @@ variable "backend_edition" { variable "backend_instance_type" { description = "The instance type to use for the Vault backend. Must be arm64/nitro compatible" - type = string - default = "t4g.small" + type = string + default = "t4g.small" } variable "backend_license_path" {