Files
opentf/internal/command
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
..
2021-08-17 15:20:05 -07:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-10-28 11:51:39 -04:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-10-28 19:29:21 -05:00
2021-05-17 14:09:07 -07:00
2021-10-28 19:29:21 -05:00
2021-09-28 17:58:40 -04:00
2021-09-01 11:36:21 -04:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00
2021-05-17 14:09:07 -07:00