Add get_local_metadata step back into upgrade scenario (#22419)

This commit is contained in:
Rebecca Willett
2023-08-18 12:04:55 -04:00
committed by GitHub
parent fc71469036
commit 6ae9f8d4ed
5 changed files with 23 additions and 18 deletions

View File

@@ -108,7 +108,7 @@ scenario "replication" {
// This step reads the contents of the backend license if we're using a Consul backend and // This step reads the contents of the backend license if we're using a Consul backend and
// the edition is "ent". // the edition is "ent".
step "read_backend_license" { 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 module = module.read_license
variables { variables {
@@ -231,7 +231,7 @@ scenario "replication" {
variables { variables {
cluster_name = step.create_primary_cluster_backend_targets.cluster_name cluster_name = step.create_primary_cluster_backend_targets.cluster_name
cluster_tag_key = local.backend_tag_key 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 = { release = {
edition = var.backend_edition edition = var.backend_edition
version = matrix.consul_version version = matrix.consul_version
@@ -257,7 +257,7 @@ scenario "replication" {
awskms_unseal_key_arn = step.create_vpc.kms_key_arn awskms_unseal_key_arn = step.create_vpc.kms_key_arn
backend_cluster_name = step.create_primary_cluster_backend_targets.cluster_name backend_cluster_name = step.create_primary_cluster_backend_targets.cluster_name
backend_cluster_tag_key = local.backend_tag_key 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 cluster_name = step.create_primary_cluster_targets.cluster_name
consul_release = matrix.primary_backend == "consul" ? { consul_release = matrix.primary_backend == "consul" ? {
edition = var.backend_edition edition = var.backend_edition
@@ -287,7 +287,7 @@ scenario "replication" {
variables { variables {
cluster_name = step.create_secondary_cluster_backend_targets.cluster_name cluster_name = step.create_secondary_cluster_backend_targets.cluster_name
cluster_tag_key = local.backend_tag_key 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 = { release = {
edition = var.backend_edition edition = var.backend_edition
version = matrix.consul_version version = matrix.consul_version
@@ -313,7 +313,7 @@ scenario "replication" {
awskms_unseal_key_arn = step.create_vpc.kms_key_arn awskms_unseal_key_arn = step.create_vpc.kms_key_arn
backend_cluster_name = step.create_secondary_cluster_backend_targets.cluster_name backend_cluster_name = step.create_secondary_cluster_backend_targets.cluster_name
backend_cluster_tag_key = local.backend_tag_key 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 cluster_name = step.create_secondary_cluster_targets.cluster_name
consul_release = matrix.secondary_backend == "consul" ? { consul_release = matrix.secondary_backend == "consul" ? {
edition = var.backend_edition edition = var.backend_edition
@@ -555,7 +555,7 @@ scenario "replication" {
backend_cluster_name = step.create_primary_cluster_backend_targets.cluster_name backend_cluster_name = step.create_primary_cluster_backend_targets.cluster_name
backend_cluster_tag_key = local.backend_tag_key backend_cluster_tag_key = local.backend_tag_key
cluster_name = step.create_primary_cluster_targets.cluster_name 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" ? { consul_release = matrix.primary_backend == "consul" ? {
edition = var.backend_edition edition = var.backend_edition
version = matrix.consul_version version = matrix.consul_version

View File

@@ -172,7 +172,7 @@ scenario "smoke" {
variables { variables {
cluster_name = step.create_vault_cluster_backend_targets.cluster_name cluster_name = step.create_vault_cluster_backend_targets.cluster_name
cluster_tag_key = local.backend_tag_key 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 = { release = {
edition = var.backend_edition edition = var.backend_edition
version = matrix.consul_version version = matrix.consul_version
@@ -199,7 +199,7 @@ scenario "smoke" {
backend_cluster_name = step.create_vault_cluster_backend_targets.cluster_name backend_cluster_name = step.create_vault_cluster_backend_targets.cluster_name
backend_cluster_tag_key = local.backend_tag_key backend_cluster_tag_key = local.backend_tag_key
cluster_name = step.create_vault_cluster_targets.cluster_name 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" ? { consul_release = matrix.backend == "consul" ? {
edition = var.backend_edition edition = var.backend_edition
version = matrix.consul_version version = matrix.consul_version

View File

@@ -15,10 +15,10 @@ scenario "ui" {
] ]
locals { locals {
arch = "amd64" arch = "amd64"
artifact_type = "bundle" artifact_type = "bundle"
backend_license_path = abspath(var.backend_license_path != null ? var.backend_license_path : joinpath(path.root, "./support/consul.hclic")) 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 = { build_tags = {
"oss" = ["ui"] "oss" = ["ui"]
"ent" = ["ui", "enterprise", "ent"] "ent" = ["ui", "enterprise", "ent"]
@@ -139,7 +139,7 @@ scenario "ui" {
variables { variables {
cluster_name = step.create_vault_cluster_backend_targets.cluster_name cluster_name = step.create_vault_cluster_backend_targets.cluster_name
cluster_tag_key = local.backend_tag_key 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 = { release = {
edition = var.backend_edition edition = var.backend_edition
version = local.consul_version version = local.consul_version
@@ -165,7 +165,7 @@ scenario "ui" {
backend_cluster_name = step.create_vault_cluster_backend_targets.cluster_name backend_cluster_name = step.create_vault_cluster_backend_targets.cluster_name
backend_cluster_tag_key = local.backend_tag_key backend_cluster_tag_key = local.backend_tag_key
cluster_name = step.create_vault_cluster_targets.cluster_name 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" ? { consul_release = matrix.backend == "consul" ? {
edition = var.backend_edition edition = var.backend_edition
version = local.consul_version version = local.consul_version

View File

@@ -29,7 +29,7 @@ scenario "upgrade" {
locals { locals {
backend_license_path = abspath(var.backend_license_path != null ? var.backend_license_path : joinpath(path.root, "./support/consul.hclic")) 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 = { build_tags = {
"oss" = ["ui"] "oss" = ["ui"]
"ent" = ["ui", "enterprise", "ent"] "ent" = ["ui", "enterprise", "ent"]
@@ -61,6 +61,11 @@ scenario "upgrade" {
vault_tag_key = "Type" // enos_vault_start expects Type as the tag key 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 # This step gets/builds the upgrade artifact that we will upgrade to
step "build_vault" { step "build_vault" {
module = "build_${matrix.artifact_source}" module = "build_${matrix.artifact_source}"
@@ -162,7 +167,7 @@ scenario "upgrade" {
variables { variables {
cluster_name = step.create_vault_cluster_backend_targets.cluster_name cluster_name = step.create_vault_cluster_backend_targets.cluster_name
cluster_tag_key = local.backend_tag_key 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 = { release = {
edition = var.backend_edition edition = var.backend_edition
version = matrix.consul_version version = matrix.consul_version
@@ -187,7 +192,7 @@ scenario "upgrade" {
awskms_unseal_key_arn = step.create_vpc.kms_key_arn awskms_unseal_key_arn = step.create_vpc.kms_key_arn
backend_cluster_name = step.create_vault_cluster_backend_targets.cluster_name backend_cluster_name = step.create_vault_cluster_backend_targets.cluster_name
backend_cluster_tag_key = local.backend_tag_key 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 cluster_name = step.create_vault_cluster_targets.cluster_name
consul_release = matrix.backend == "consul" ? { consul_release = matrix.backend == "consul" ? {
edition = var.backend_edition edition = var.backend_edition

View File

@@ -53,8 +53,8 @@ variable "backend_edition" {
variable "backend_instance_type" { variable "backend_instance_type" {
description = "The instance type to use for the Vault backend. Must be arm64/nitro compatible" description = "The instance type to use for the Vault backend. Must be arm64/nitro compatible"
type = string type = string
default = "t4g.small" default = "t4g.small"
} }
variable "backend_license_path" { variable "backend_license_path" {