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

add composer test fixes, backend bucket signed url key #2631

Merged
merged 1 commit into from
Nov 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add composer test fixes, backend bucket signed url key
  • Loading branch information
slevenick committed Nov 8, 2019
commit 65ccfcd8b1f30acb2fcce827eb4f762955dc4ab2
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ func resourceComposerEnvironmentCreate(d *schema.ResourceData, meta interface{})
}

// Store the ID now
id, err := replaceVars(d, config, "{{project}}/{{region}}/{{name}}")
id, err := replaceVars(d, config, "projects/{{project}}/locations/{{region}}/environments/{{name}}")
if err != nil {
return fmt.Errorf("Error constructing id: %s", err)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,13 +285,13 @@ func testAccComposerEnvironmentDestroy(s *terraform.State) error {
}

idTokens := strings.Split(rs.Primary.ID, "/")
if len(idTokens) != 3 {
return fmt.Errorf("Invalid ID %q, expected format {project}/{region}/{environment}", rs.Primary.ID)
if len(idTokens) != 6 {
return fmt.Errorf("Invalid ID %q, expected format projects/{project}/regions/{region}/environments/{environment}", rs.Primary.ID)
}
envName := &composerEnvironmentName{
Project: idTokens[0],
Region: idTokens[1],
Environment: idTokens[2],
Project: idTokens[1],
Region: idTokens[3],
Environment: idTokens[5],
}

_, err := config.clientComposer.Projects.Locations.Environments.Get(envName.resourceName()).Do()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ func checkComputeBackendBucketSignedUrlKeyExists(s *terraform.State) (bool, erro
}

config := testAccProvider.Meta().(*Config)
keyName := rs.Primary.ID
keyName := rs.Primary.Attributes["name"]

url, err := replaceVarsForTest(config, rs, "{{ComputeBasePath}}projects/{{project}}/global/backendBuckets/{{backend_bucket}}")
if err != nil {
Expand Down