diff --git a/acceptance/framework/config/config.go b/acceptance/framework/config/config.go index 310955e8f8..c771e49653 100644 --- a/acceptance/framework/config/config.go +++ b/acceptance/framework/config/config.go @@ -52,6 +52,9 @@ type TestConfig struct { ConsulVersion *version.Version EnvoyImage string + VaultHelmChartVersion string + VaultServerVersion string + NoCleanupOnFailure bool DebugDirectory string diff --git a/acceptance/framework/flags/flags.go b/acceptance/framework/flags/flags.go index b8c315044b..ea58fda058 100644 --- a/acceptance/framework/flags/flags.go +++ b/acceptance/framework/flags/flags.go @@ -34,11 +34,13 @@ type TestFlags struct { flagEnableTransparentProxy bool - flagHelmChartVersion string - flagConsulImage string - flagConsulK8sImage string - flagConsulVersion string - flagEnvoyImage string + flagHelmChartVersion string + flagConsulImage string + flagConsulK8sImage string + flagConsulVersion string + flagEnvoyImage string + flagVaultHelmChartVersion string + flagVaultServerVersion string flagNoCleanupOnFailure bool @@ -72,6 +74,8 @@ func (t *TestFlags) init() { flag.StringVar(&t.flagConsulVersion, "consul-version", "", "The consul version used for all tests.") flag.StringVar(&t.flagHelmChartVersion, "helm-chart-version", config.HelmChartPath, "The helm chart used for all tests.") flag.StringVar(&t.flagEnvoyImage, "envoy-image", "", "The Envoy image to use for all tests.") + flag.StringVar(&t.flagVaultServerVersion, "vault-server-version", "", "The vault serverversion used for all tests.") + flag.StringVar(&t.flagVaultHelmChartVersion, "vault-helm-chart-version", "", "The Vault helm chart used for all tests.") flag.BoolVar(&t.flagEnableMultiCluster, "enable-multi-cluster", false, "If true, the tests that require multiple Kubernetes clusters will be run. "+ @@ -142,6 +146,7 @@ func (t *TestFlags) TestConfigFromFlags() *config.TestConfig { // if the Version is empty consulVersion will be nil consulVersion, _ := version.NewVersion(t.flagConsulVersion) + //vaultserverVersion, _ := version.NewVersion(t.flagVaultServerVersion) return &config.TestConfig{ Kubeconfig: t.flagKubeconfig, @@ -166,11 +171,13 @@ func (t *TestFlags) TestConfigFromFlags() *config.TestConfig { DisablePeering: t.flagDisablePeering, - HelmChartVersion: t.flagHelmChartVersion, - ConsulImage: t.flagConsulImage, - ConsulK8SImage: t.flagConsulK8sImage, - ConsulVersion: consulVersion, - EnvoyImage: t.flagEnvoyImage, + HelmChartVersion: t.flagHelmChartVersion, + ConsulImage: t.flagConsulImage, + ConsulK8SImage: t.flagConsulK8sImage, + ConsulVersion: consulVersion, + EnvoyImage: t.flagEnvoyImage, + VaultHelmChartVersion: t.flagVaultHelmChartVersion, + VaultServerVersion: t.flagVaultServerVersion, NoCleanupOnFailure: t.flagNoCleanupOnFailure, DebugDirectory: tempDir, diff --git a/acceptance/framework/vault/vault_cluster.go b/acceptance/framework/vault/vault_cluster.go index 26da56b646..e0030490c9 100644 --- a/acceptance/framework/vault/vault_cluster.go +++ b/acceptance/framework/vault/vault_cluster.go @@ -59,13 +59,20 @@ func NewVaultCluster(t *testing.T, ctx environment.TestContext, cfg *config.Test if cfg.EnablePodSecurityPolicies { values["global.psp.enable"] = "true" } + if cfg.VaultServerVersion != "" { + values["server.image.tag"] = cfg.VaultServerVersion + } + vaultHelmChartVersion := defaultVaultHelmChartVersion + if cfg.VaultHelmChartVersion != "" { + vaultHelmChartVersion = cfg.VaultHelmChartVersion + } helpers.MergeMaps(values, helmValues) vaultHelmOpts := &helm.Options{ SetValues: values, KubectlOptions: kopts, Logger: logger, - Version: defaultVaultHelmChartVersion, + Version: vaultHelmChartVersion, } helm.AddRepo(t, vaultHelmOpts, "hashicorp", "https://helm.releases.hashicorp.com")