From 8c69e943f8c991588bb53c9ca4e4a0f4686e29f7 Mon Sep 17 00:00:00 2001 From: The Magician Date: Fri, 29 Oct 2021 11:14:46 -0700 Subject: [PATCH] Fix functions build_environment_variable updating (#5381) (#10447) Signed-off-by: Modular Magician --- .changelog/5381.txt | 3 +++ google/resource_cloudfunctions_function.go | 2 +- google/resource_cloudfunctions_function_test.go | 6 +++--- 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 .changelog/5381.txt diff --git a/.changelog/5381.txt b/.changelog/5381.txt new file mode 100644 index 00000000000..8ec013c0699 --- /dev/null +++ b/.changelog/5381.txt @@ -0,0 +1,3 @@ +```release-note:none + +``` diff --git a/google/resource_cloudfunctions_function.go b/google/resource_cloudfunctions_function.go index f7ae761c6fe..7632c3c499a 100644 --- a/google/resource_cloudfunctions_function.go +++ b/google/resource_cloudfunctions_function.go @@ -617,7 +617,7 @@ func resourceCloudFunctionsUpdate(d *schema.ResourceData, meta interface{}) erro } if d.HasChange("build_environment_variables") { - function.EnvironmentVariables = expandEnvironmentVariables(d) + function.BuildEnvironmentVariables = expandBuildEnvironmentVariables(d) updateMaskArr = append(updateMaskArr, "buildEnvironmentVariables") } diff --git a/google/resource_cloudfunctions_function_test.go b/google/resource_cloudfunctions_function_test.go index 9e3f121e629..3742eabc2ea 100644 --- a/google/resource_cloudfunctions_function_test.go +++ b/google/resource_cloudfunctions_function_test.go @@ -620,7 +620,7 @@ resource "google_cloudfunctions_function" "function" { TEST_ENV_VARIABLE = "test-env-variable-value" } build_environment_variables = { - TEST_ENV_VARIABLE = "test-env-variable-value" + TEST_ENV_VARIABLE = "test-build-env-variable-value" } max_instances = 10 } @@ -660,8 +660,8 @@ resource "google_cloudfunctions_function" "function" { NEW_ENV_VARIABLE = "new-env-variable-value" } build_environment_variables = { - TEST_ENV_VARIABLE = "test-env-variable-value" - NEW_ENV_VARIABLE = "new-env-variable-value" + TEST_ENV_VARIABLE = "test-build-env-variable-value" + NEW_ENV_VARIABLE = "new-build-env-variable-value" } max_instances = 15 }