Merge pull request #28412 from hashicorp/alisdair/fix-missing-apply-output-for-remote-operations
cli: Fix missing apply summary for remote runs
This commit is contained in:
commit
7b2c7dddf3
|
@ -704,6 +704,9 @@ func (b *Remote) Operation(ctx context.Context, op *backend.Operation) (*backend
|
|||
|
||||
// Check if we need to use the local backend to run the operation.
|
||||
if b.forceLocal || !w.Operations {
|
||||
// Record that we're forced to run operations locally to allow the
|
||||
// command package UI to operate correctly
|
||||
b.forceLocal = true
|
||||
return b.local.Operation(ctx, op)
|
||||
}
|
||||
|
||||
|
@ -949,6 +952,10 @@ func (b *Remote) VerifyWorkspaceTerraformVersion(workspaceName string) tfdiags.D
|
|||
return diags
|
||||
}
|
||||
|
||||
func (b *Remote) IsLocalOperations() bool {
|
||||
return b.forceLocal
|
||||
}
|
||||
|
||||
// Colorize returns the Colorize structure that can be used for colorizing
|
||||
// output. This is guaranteed to always return a non-nil value and so useful
|
||||
// as a helper to wrap any potentially colored strings.
|
||||
|
|
|
@ -123,8 +123,8 @@ func (c *ApplyCommand) Run(rawArgs []string) int {
|
|||
}
|
||||
|
||||
// Render the resource count and outputs, unless we're using the remote
|
||||
// backend, in which case these are rendered remotely
|
||||
if _, isRemoteBackend := be.(*remoteBackend.Remote); !isRemoteBackend {
|
||||
// backend locally, in which case these are rendered remotely
|
||||
if rb, isRemoteBackend := be.(*remoteBackend.Remote); !isRemoteBackend || rb.IsLocalOperations() {
|
||||
view.ResourceCount(args.State.StateOutPath)
|
||||
if !c.Destroy && op.State != nil {
|
||||
view.Outputs(op.State.RootModule().OutputValues)
|
||||
|
|
Loading…
Reference in New Issue