mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-28 18:01:01 -06:00
9d7fdbea2d
For non-interactive contexts, Terraform is typically executed with the flag -input=false. However for runs that are not set to auto approve, the cloud integration will prompt a user for approval input even with input being set to false. This commit enables the cloud integration to know the value of the input flag and use it to determine whether or not to ask the user for input. If -input is set to false and the run cannot be auto approved, the cloud integration will throw an error stating run confirmation can no longer be handled in the CLI and that they must do so through the browser.
23 lines
443 B
Go
23 lines
443 B
Go
package cloud
|
|
|
|
import (
|
|
"github.com/hashicorp/terraform/internal/backend"
|
|
)
|
|
|
|
// CLIInit implements backend.CLI
|
|
func (b *Cloud) CLIInit(opts *backend.CLIOpts) error {
|
|
if cli, ok := b.local.(backend.CLI); ok {
|
|
if err := cli.CLIInit(opts); err != nil {
|
|
return err
|
|
}
|
|
}
|
|
|
|
b.CLI = opts.CLI
|
|
b.CLIColor = opts.CLIColor
|
|
b.ContextOpts = opts.ContextOpts
|
|
b.runningInAutomation = opts.RunningInAutomation
|
|
b.input = opts.Input
|
|
|
|
return nil
|
|
}
|