Merge pull request #30061 from hashicorp/barrettclark/cloud-apply-without-init-messaging

Cloud: Apply without init error message
This commit is contained in:
Chris Arcand 2021-12-01 11:40:55 -06:00 committed by GitHub
commit 71a42f6a4c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 12 deletions

View File

@ -737,7 +737,7 @@ func (m *Meta) determineInitReason(previousBackendType string, currentBackendTyp
diags = diags.Append(tfdiags.Sourceless(
tfdiags.Error,
"Terraform Cloud initialization required: please run \"terraform init\"",
fmt.Sprintf(strings.TrimSpace(errBackendInitCloudMigration), initReason),
fmt.Sprintf(strings.TrimSpace(errBackendInitCloud), initReason),
))
default:
diags = diags.Append(tfdiags.Sourceless(
@ -1510,17 +1510,6 @@ hasn't changed and try again. At this point, no changes to your existing
configuration or state have been made.
`
const errBackendInitCloudMigration = `
Reason: %s.
Migrating to Terraform Cloud requires reinitialization, to discover which Terraform Cloud workspaces belong to this configuration and to optionally migrate existing state to the corresponding Terraform Cloud workspaces.
To re-initialize, run:
terraform init
Terraform has not yet made changes to your existing configuration or state.
`
const errBackendInitCloud = `
Reason: %s.