Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't create composer preview versions #9201

Closed
hlastraspfx opened this issue May 20, 2021 · 7 comments · Fixed by GoogleCloudPlatform/magic-modules#4797, #9255 or hashicorp/terraform-provider-google-beta#3287
Assignees
Labels
bug forward/review In review; remove label to forward service/composer

Comments

@hlastraspfx
Copy link

hlastraspfx commented May 20, 2021

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request.
  • Please do not leave +1 or me too comments, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.
  • If an issue is assigned to the modular-magician user, it is either in the process of being autogenerated, or is planned to be autogenerated soon. If an issue is assigned to a user, that user is claiming responsibility for the issue. If an issue is assigned to hashibot, a community member has claimed the issue already.

Terraform Version

Terraform v0.15.3
on darwin_amd64

Affected Resource(s)

google_composer_environment

Terraform Configuration Files

resource "google_composer_environment" "airflow" {
  provider = google-beta
  [...]
  software_config {
    image_version  = "composer-1.17.0-preview.0-airflow-2.0.1"
    [...]
  }
}

Debug Output

Panic Output

Expected Behavior

Creation of the resource.

Actual Behavior

Error:

Error: “config.0.software_config.0.image_version” (“composer-1.17.0-preview.0-airflow-2.0.1") doesn’t match regexp “composer-([0-9]+\\.[0-9]+\\.[0-9]+|latest)-airflow-([0-9]+\\.[0-9]+(\\.[0-9]+.*)?)”

Steps to Reproduce

  1. terraform apply

Important Factoids

References

  • #0000
@venkykuberan venkykuberan self-assigned this May 20, 2021
@hlastraspfx
Copy link
Author

I have a solution ready:

diff --git a/google/resource_composer_environment.go b/google/resource_composer_environment.go
index fa00add3f..a3f5b4111 100644
--- a/google/resource_composer_environment.go
+++ b/google/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]+|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/resource_composer_environment_test.go b/google/resource_composer_environment_test.go
index eb3cc8ce0..5da8d22f0 100644
--- a/google/resource_composer_environment_test.go
+++ b/google/resource_composer_environment_test.go
@@ -40,6 +40,7 @@ func TestComposerImageVersionDiffSuppress(t *testing.T) {
                {"airflow equivalent", "composer-1.4.0-airflow-1.10.0", "composer-1.4.0-airflow-1.10", true},
                {"airflow different", "composer-1.4.0-airflow-1.10.0", "composer-1.4-airflow-1.9.0", false},
                {"airflow different composer latest", "composer-1.4.0-airflow-1.10.0", "composer-latest-airflow-1.9.0", false},
+               {"preview", "composer-1.17.0-preview.0-airflow-2.0.1", "composer-1.17.0-preview.0-airflow-2.0.1", true},
        }
 
        for _, tc := range cases {

@scdekov
Copy link

scdekov commented May 25, 2021

Is there any workaround that we can use until this is fixed?

@melinath
Copy link
Collaborator

It looks like this will be resolved by GoogleCloudPlatform/magic-modules#4797

@melinath
Copy link
Collaborator

This is causing failures of the following tests:

  • TestAccComposerEnvironment_update
  • TestAccComposerEnvironment_withSoftwareConfig

@krishna4ldw
Copy link

Is this fixed in new terraform version or google provider version for terraform?

@rileykarson
Copy link
Collaborator

This'll be fixed in a provider version, likely 3.71.0 on June 6th.

@github-actions
Copy link

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 27, 2021
@github-actions github-actions bot added service/composer forward/review In review; remove label to forward labels Jan 14, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.