terraform/internal/cloud
Nick Fagerlund 02e62c9851
Cloud: Init without erroring when no workspaces match the `tags` (#29835)
Previously, `terraform init` was throwing an error if you configured the cloud
block with `tags` and there weren't any tagged workspaces yet. Confusing and
alienating, since that that's a fairly normal situation! Basically TFC was
handling an empty list of workspaces worse than other backends, because it
doesn't support an unnamed default workspace.

This commit catches that condition during `Meta.selectBackend()` and asks the
user to pick a name for their first tagged workspace. If they cancel out, we
still error, but if we know what name they want, we can handle it the same way
as a nonexistent workspace specified in `name` -- just pass it to
`Meta.SetWorkspace()`, and let the workspace get implicitly created when
`InitCommand.Run()` eventually calls `StateMgr()`.
2021-11-01 10:20:15 -07:00
..
e2e Cloud: Init without erroring when no workspaces match the `tags` (#29835) 2021-11-01 10:20:15 -07:00
testdata Run apply -refresh-state instead of refresh 2021-10-28 19:29:12 -05:00
backend.go cloud: Fix prerelease version constraint checks 2021-11-01 11:12:58 -04:00
backend_apply.go Add run variables to cloud plan operations from non-file sources 2021-10-28 19:29:12 -05:00
backend_apply_test.go Update HasResource to HasManagedResourceInstanceObjects 2021-10-28 19:29:15 -05:00
backend_cli.go Restore API version checking, with internal usage accounted for 2021-10-28 19:29:18 -05:00
backend_colorize.go Initial commit of 'cloud' package 2021-10-28 19:29:09 -05:00
backend_common.go Add run variables to cloud plan operations from non-file sources 2021-10-28 19:29:12 -05:00
backend_context.go Remove prefix from the cloud backend config 2021-10-28 19:29:12 -05:00
backend_context_test.go Rename cloud.testBackendDefault -> cloud.testBackendWithName 2021-10-28 19:29:11 -05:00
backend_plan.go Run apply -refresh-state instead of refresh 2021-10-28 19:29:12 -05:00
backend_plan_test.go Remove prefix from the cloud backend config 2021-10-28 19:29:12 -05:00
backend_refresh_test.go Run apply -refresh-state instead of refresh 2021-10-28 19:29:12 -05:00
backend_state.go Initial commit of 'cloud' package 2021-10-28 19:29:09 -05:00
backend_state_test.go Rename cloud.testBackendDefault -> cloud.testBackendWithName 2021-10-28 19:29:11 -05:00
backend_test.go cloud: Fix prerelease version constraint checks 2021-11-01 11:12:58 -04:00
cloud_variables.go Add run variables to cloud plan operations from non-file sources 2021-10-28 19:29:12 -05:00
cloud_variables_test.go Add run variables to cloud plan operations from non-file sources 2021-10-28 19:29:12 -05:00
errors.go Simplify logic flow: everything is a constraint 2021-10-28 19:29:13 -05:00
remote_test.go Initial commit of 'cloud' package 2021-10-28 19:29:09 -05:00
testing.go Remove prefix from the cloud backend config 2021-10-28 19:29:12 -05:00
tfe_client_mock.go Fix broken rename behavior in tfe_client_mock.go 2021-10-28 19:29:18 -05:00