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

Update BootstrapProject to support use across multiple projects/environments #5329

Conversation

modular-magician
Copy link
Collaborator

Only affects tests

With the project split work coming soon to support isolating our test environments, one of the issues we run into is that the projects for all 3 environments are occupying the same space. This is problematic for bootstrapped projects, because each environment will attempt to use the same project for these tests (and potentially do other things like change billing account or permissions).

The fix proposed here is to simply append the "environment test project" id to the end of the bootstrapped project id. This way, each environment will end up creating a unique project that is owned by that environment.

I'm not sure if this will fix hashicorp/terraform-provider-google#13711, but it's possible, because I think we started seeing issues that as soon as the new GA project started running. If not, then I can follow up after this gets merged to double check that there is not some other issue related to the multiple environments.

If this PR is for Terraform, I acknowledge that I have:

  • Searched through the issue tracker for an open issue that this either resolves or contributes to, commented on it to claim it, and written "fixes {url}" or "part of {url}" in this PR description. If there were no relevant open issues, I opened one and commented that I would like to work on it (not necessary for very small changes).
  • Ensured that all new fields I added that can be set by a user appear in at least one example (for generated resources) or third_party test (for handwritten resources or update tests).
  • Generated Terraform providers, and ran make test and make lint in the generated providers to ensure it passes unit and linter tests.
  • Ran relevant acceptance tests using my own Google Cloud project and credentials (If the acceptance tests do not yet pass or you are unable to run them, please let your reviewer know).
  • Read the Release Notes Guide before writing my release note below.

Release Note Template for Downstream PRs (will be copied)


Derived from GoogleCloudPlatform/magic-modules#7369

…onments (hashicorp#7369)

* Update BootstrapProject to support use across multiple projects/environments

* Fix typo

* Fix arguments for getTestProjectFromEnv

* Fix project naming strategy for BootstrapProject to produce valid names in all envs

* Fix typo

* Fix function name after rebase

Signed-off-by: Modular Magician <[email protected]>
@modular-magician modular-magician merged commit 9be3156 into hashicorp:main Mar 14, 2023
@modular-magician modular-magician deleted the downstream-pr-6d8460a462f6749313a7fd9f0428988358ba379a branch November 16, 2024 02:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failing test(s): TestAccContainerCluster_failedCreation
1 participant