From 8569062913a0c8a07e1f8b711bd7960a424b8c9c Mon Sep 17 00:00:00 2001 From: Modular Magician Date: Fri, 13 Aug 2021 09:05:00 +0000 Subject: [PATCH] Fix composer environment version regexp (#5039) Signed-off-by: Modular Magician --- .changelog/5039.txt | 3 +++ google-beta/resource_composer_environment.go | 2 +- google-beta/resource_dataproc_cluster_test.go | 3 +-- google-beta/resource_gke_hub_feature_membership_test.go | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) create mode 100644 .changelog/5039.txt diff --git a/.changelog/5039.txt b/.changelog/5039.txt new file mode 100644 index 0000000000..9f4baad79f --- /dev/null +++ b/.changelog/5039.txt @@ -0,0 +1,3 @@ +```release-note:bug +composer: fixed environment version regexp to explicitly require . (dot) instead of any character after 'preview' (example: composer-2.0.0-preview.0-airflow-2.1.1) +``` diff --git a/google-beta/resource_composer_environment.go b/google-beta/resource_composer_environment.go index cc4a6e3de8..afbc68c233 100644 --- a/google-beta/resource_composer_environment.go +++ b/google-beta/resource_composer_environment.go @@ -16,7 +16,7 @@ import ( const ( composerEnvironmentEnvVariablesRegexp = "[a-zA-Z_][a-zA-Z0-9_]*." composerEnvironmentReservedAirflowEnvVarRegexp = "AIRFLOW__[A-Z0-9_]+__[A-Z0-9_]+" - composerEnvironmentVersionRegexp = `composer-([0-9]+\.[0-9]+\.[0-9]+(-preview.[0-9]+)?|latest)-airflow-([0-9]+\.[0-9]+(\.[0-9]+.*)?)` + composerEnvironmentVersionRegexp = `composer-([0-9]+\.[0-9]+\.[0-9]+(-preview\.[0-9]+)?|latest)-airflow-([0-9]+\.[0-9]+(\.[0-9]+.*)?)` ) var composerEnvironmentReservedEnvVar = map[string]struct{}{ diff --git a/google-beta/resource_dataproc_cluster_test.go b/google-beta/resource_dataproc_cluster_test.go index 79b887900b..8f3596cc80 100644 --- a/google-beta/resource_dataproc_cluster_test.go +++ b/google-beta/resource_dataproc_cluster_test.go @@ -13,9 +13,8 @@ import ( "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform" - "google.golang.org/api/googleapi" - dataproc "google.golang.org/api/dataproc/v1beta2" + "google.golang.org/api/googleapi" ) func TestDataprocExtractInitTimeout(t *testing.T) { diff --git a/google-beta/resource_gke_hub_feature_membership_test.go b/google-beta/resource_gke_hub_feature_membership_test.go index 32fa84c196..9e1f2ea64d 100644 --- a/google-beta/resource_gke_hub_feature_membership_test.go +++ b/google-beta/resource_gke_hub_feature_membership_test.go @@ -5,7 +5,7 @@ import ( "fmt" "testing" - dcl "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl" + "github.com/GoogleCloudPlatform/declarative-resource-client-library/dcl" gkehub "github.com/GoogleCloudPlatform/declarative-resource-client-library/services/google/gkehub/beta" "github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource" "github.com/hashicorp/terraform-plugin-sdk/v2/terraform"