From 0841f427f0a7bdc633fd74df5aea19ad211b8aa9 Mon Sep 17 00:00:00 2001 From: Stoyan Rachev Date: Fri, 5 Nov 2021 18:24:53 +0200 Subject: [PATCH] Upgrade terraform to 0.15.5 --- build/alicloud/TF_VERSION | 2 +- build/all/TF_VERSION | 2 +- build/aws/TF_VERSION | 2 +- build/azure/TF_VERSION | 2 +- build/equinixmetal/TF_VERSION | 2 +- build/gcp/TF_VERSION | 2 +- build/openstack/TF_VERSION | 2 +- build/slim/TF_VERSION | 2 +- pkg/terraformer/terraformer.go | 5 ++--- test/utils/objects.go | 2 +- 10 files changed, 11 insertions(+), 12 deletions(-) diff --git a/build/alicloud/TF_VERSION b/build/alicloud/TF_VERSION index ecf56ca4..1282fff5 100644 --- a/build/alicloud/TF_VERSION +++ b/build/alicloud/TF_VERSION @@ -1 +1 @@ -0.14.11 +0.15.5 diff --git a/build/all/TF_VERSION b/build/all/TF_VERSION index ecf56ca4..1282fff5 100644 --- a/build/all/TF_VERSION +++ b/build/all/TF_VERSION @@ -1 +1 @@ -0.14.11 +0.15.5 diff --git a/build/aws/TF_VERSION b/build/aws/TF_VERSION index ecf56ca4..1282fff5 100644 --- a/build/aws/TF_VERSION +++ b/build/aws/TF_VERSION @@ -1 +1 @@ -0.14.11 +0.15.5 diff --git a/build/azure/TF_VERSION b/build/azure/TF_VERSION index ecf56ca4..1282fff5 100644 --- a/build/azure/TF_VERSION +++ b/build/azure/TF_VERSION @@ -1 +1 @@ -0.14.11 +0.15.5 diff --git a/build/equinixmetal/TF_VERSION b/build/equinixmetal/TF_VERSION index ecf56ca4..1282fff5 100644 --- a/build/equinixmetal/TF_VERSION +++ b/build/equinixmetal/TF_VERSION @@ -1 +1 @@ -0.14.11 +0.15.5 diff --git a/build/gcp/TF_VERSION b/build/gcp/TF_VERSION index ecf56ca4..1282fff5 100644 --- a/build/gcp/TF_VERSION +++ b/build/gcp/TF_VERSION @@ -1 +1 @@ -0.14.11 +0.15.5 diff --git a/build/openstack/TF_VERSION b/build/openstack/TF_VERSION index ecf56ca4..1282fff5 100644 --- a/build/openstack/TF_VERSION +++ b/build/openstack/TF_VERSION @@ -1 +1 @@ -0.14.11 +0.15.5 diff --git a/build/slim/TF_VERSION b/build/slim/TF_VERSION index ecf56ca4..1282fff5 100644 --- a/build/slim/TF_VERSION +++ b/build/slim/TF_VERSION @@ -1 +1 @@ -0.14.11 +0.15.5 diff --git a/pkg/terraformer/terraformer.go b/pkg/terraformer/terraformer.go index ccf6d021..39781504 100644 --- a/pkg/terraformer/terraformer.go +++ b/pkg/terraformer/terraformer.go @@ -237,6 +237,7 @@ func (t *Terraformer) executeTerraform(ctx context.Context, command Command, par if command == StateReplaceProvider { args = append(args, strings.Split(string(command), " ")...) } else { + args = append(args, "-chdir="+t.paths.ConfigDir) args = append(args, string(command)) } @@ -258,11 +259,9 @@ func (t *Terraformer) executeTerraform(ctx context.Context, command Command, par if command == StateReplaceProvider { args = append(args, params...) - } else { - args = append(args, t.paths.ConfigDir) } - log.Info("executing terraform", "command", command, "args", strings.Join(args[1:], " ")) + log.Info("executing terraform", "command", command, "args", strings.Join(args, " ")) tfCmd := exec.Command(TerraformBinary, args...) logBuffer := &bytes.Buffer{} diff --git a/test/utils/objects.go b/test/utils/objects.go index 7076f702..531359d9 100644 --- a/test/utils/objects.go +++ b/test/utils/objects.go @@ -70,7 +70,7 @@ func PrepareTestObjects(ctx context.Context, c client.Client, namespacePrefix st o.StateConfigMap = &corev1.ConfigMap{ ObjectMeta: metav1.ObjectMeta{Name: "tf-state", Namespace: o.Namespace}, Data: map[string]string{ - StateKey: `{"terraform_version":"0.14.11"}`, + StateKey: `{"terraform_version":"0.15.5"}`, }, } err = o.client.Create(ctx, o.StateConfigMap)