terraform/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
..
arguments command: Remove the experimental "terraform add" command 2021-10-20 06:42:47 -07:00
cliconfig cliconfig: Fix error message about invalid credentials helper type 2021-09-29 13:36:59 -07:00
clistate Upgrade to Go 1.17 2021-08-17 15:20:05 -07:00
e2etest cli: Fix backend init failure with deleted cache 2021-10-25 12:45:35 -04:00
format command/format: Include deletion reasons in plan report 2021-09-23 14:37:08 -07:00
jsonconfig allow json output to marshal ConfigModeAttr blocks 2021-09-03 13:53:52 -04:00
jsonplan json-output: Release format version 1.0 2021-10-06 11:13:06 -04:00
jsonprovider Merge pull request #29648 from hashicorp/jbardin/tfproto6.1 2021-10-28 16:00:02 -04:00
jsonstate json-output: Release format version 1.0 2021-10-06 11:13:06 -04:00
testdata experiments: config_driven_move has concluded 2021-11-01 08:46:15 -07:00
views command: Remove the experimental "terraform add" command 2021-10-20 06:42:47 -07:00
webbrowser
workdir workdir: Start of a new package for working directory state management 2021-09-10 14:56:49 -07:00
apply.go command: Adjust skipping of resource counts for any remote implementation 2021-10-29 21:23:28 -05:00
apply_destroy_test.go
apply_test.go test planfile may need to have a specific lineage 2021-10-13 17:28:14 -04:00
autocomplete.go
autocomplete_test.go
cli_ui.go
cli_ui_test.go
command.go
command_test.go command: Remove the experimental "terraform add" command 2021-10-20 06:42:47 -07:00
console.go Merge pull request #29825 from hashicorp/jbardin/no-panicwrap 2021-10-29 14:41:05 -04:00
console_interactive.go remove wrapped streams and readline 2021-10-28 11:51:39 -04:00
console_interactive_solaris.go Upgrade to Go 1.17 2021-08-17 15:20:05 -07:00
console_test.go
flag_kv.go
flag_kv_test.go
fmt.go
fmt_test.go
get.go
get_test.go fix temp directory handling in some tests 2021-09-13 13:45:04 -04:00
graph.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
graph_test.go
hook_module_install.go
import.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
import_test.go backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
init.go Update copy for terraform init with cloud block 2021-10-28 19:29:16 -05:00
init_test.go Merge pull request #29773 from hashicorp/alisdair/init-lock-flags 2021-10-19 09:45:15 -04:00
login.go insert panic handlers 2021-10-28 11:51:39 -04:00
login_test.go
logout.go
logout_test.go
meta.go cli: Fix init failure with deleted cache 2021-10-21 08:44:26 -04:00
meta_backend.go Cloud: Init without erroring when no workspaces match the `tags` (#29835) 2021-11-01 10:20:15 -07:00
meta_backend_migrate.go Adjust default workspace naming prompt 2021-10-28 19:29:21 -05:00
meta_backend_migrate_test.go Backend State Migration to `cloud`: Multiple Workspaces 2021-10-28 19:29:13 -05:00
meta_backend_test.go command/init: Fail if -input=false but required 2021-10-25 15:08:10 -04:00
meta_config.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
meta_dependencies.go backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
meta_new.go
meta_providers.go command: Early error message for missing cache entries of locked providers 2021-10-05 10:59:59 -07:00
meta_test.go
meta_vars.go
output.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
output_test.go
plan.go Clarify legacy Ui comments 2021-10-28 19:29:21 -05:00
plan_test.go backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
plugins.go workdir: Start of a new package for working directory state management 2021-09-10 14:56:49 -07:00
plugins_lock.go core: Simplify and centralize plugin availability checks 2021-10-01 14:43:58 -07:00
plugins_lock_test.go
plugins_test.go
providers.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
providers_lock.go
providers_lock_test.go
providers_mirror.go
providers_mirror_test.go
providers_schema.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
providers_schema_test.go
providers_test.go
push.go
refresh.go Clarify legacy Ui comments 2021-10-28 19:29:21 -05:00
refresh_test.go
show.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
show_test.go remove debugging println 2021-09-28 17:58:40 -04:00
state_command.go
state_list.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
state_list_test.go
state_meta.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
state_mv.go
state_mv_test.go de-linting 2021-09-01 11:36:21 -04:00
state_pull.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
state_pull_test.go
state_push.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
state_push_test.go
state_replace_provider.go
state_replace_provider_test.go
state_rm.go
state_rm_test.go
state_show.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
state_show_test.go
state_test.go
taint.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
taint_test.go
test.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
test_test.go
ui_input.go command: Ensure all answers were used in command.testInputResponseMap 2021-09-21 22:26:16 -05:00
ui_input_test.go
unlock.go
unlock_test.go
untaint.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
untaint_test.go
validate.go core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
validate_test.go
version.go
version_test.go
workspace_command.go command/workspace_delete: Allow deleting a workspace with empty husks 2021-10-13 13:54:11 -07:00
workspace_command_test.go command/workspace_delete: Allow deleting a workspace with empty husks 2021-10-13 13:54:11 -07:00
workspace_delete.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
workspace_list.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
workspace_new.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
workspace_select.go Add cloud {} configuration block for Terraform Cloud 2021-10-28 19:29:09 -05:00
workspace_show.go