Fix for no json output of state locking actions for --json flag (#32451)

* Add viewType to Meta object and use it at the call sites

* Assign viewType passed from flags to state-locking cli commands

* Remove temp files

* Set correct mode for statelocker depending on json flag passed to commands

* Add StateLocker interface conformation check for StateLockerJSON

* Remove empty line at end of comment

* Pass correct ViewType to StateLocker from Backend call chain

* Pass viewType to backend migration and initialization functions

* Remove json processing info in process comment

* Restore documentation style of backendMigrateOpts
This commit is contained in:
zetHannes
2023-02-07 09:06:12 +01:00
committed by GitHub
parent 5264510c79
commit c70244426a
11 changed files with 113 additions and 29 deletions

View File

@@ -5,6 +5,7 @@ import (
"os"
"github.com/hashicorp/terraform/internal/backend"
"github.com/hashicorp/terraform/internal/command/arguments"
"github.com/hashicorp/terraform/internal/command/jsonprovider"
"github.com/hashicorp/terraform/internal/tfdiags"
)
@@ -78,7 +79,7 @@ func (c *ProvidersSchemaCommand) Run(args []string) int {
}
// Build the operation
opReq := c.Operation(b)
opReq := c.Operation(b, arguments.ViewJSON)
opReq.ConfigDir = cwd
opReq.ConfigLoader, err = c.initConfigLoader()
opReq.AllowUnsetVariables = true