You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cmdFlags.BoolVar(&init.CreateDefaultWorkspace, "create-default-workspace", true, "when -input=false, use this flag to block creation of the default workspace")
115
119
// Used for enabling experimental code that's invoked before configuration is parsed.
116
120
cmdFlags.BoolVar(&init.EnablePssExperiment, "enable-pluggable-state-storage-experiment", false, "Enable the pluggable state storage experiment")
"The flag -create-default-workspace=false is ignored when Terraform is configured to ask users for input. Instead, add -input=false or remove the -create-default-workspace flag",
Query: fmt.Sprintf("Workspace the %s workspace does not exit, would you like to create it?", backend.DefaultStateName),
1682
+
Description: desc,
1683
+
})
1684
+
iferr!=nil {
1685
+
diags=diags.Append(fmt.Errorf("Failed to confirm %s workspace creation: %w", backend.DefaultStateName, err))
1686
+
returnnil, diags
1687
+
}
1688
+
ifv!="yes" {
1689
+
diags=diags.Append(fmt.Errorf("Cancelled creation of the %s workspace", backend.DefaultStateName))
1690
+
returnnil, diags
1691
+
}
1692
+
m.createDefaultWorkspace(c, b)
1693
+
} else {
1694
+
// If input is disabled, we don't prompt before creating the default workspace.
1695
+
// However this can be blocked with other flags present.
1696
+
ifopts.CreateDefaultWorkspace {
1697
+
m.createDefaultWorkspace(c, b)
1698
+
} else {
1699
+
diags=diags.Append(&hcl.Diagnostic{
1700
+
Severity: hcl.DiagWarning,
1701
+
Summary: "The default workspace does not exist",
1702
+
Detail: "Terraform has been configured to skip creation of the default workspace in the state store. This may cause issues in subsequent Terraform operations",
0 commit comments