0
0
mirror of https://github.com/thegeeklab/wp-opentofu.git synced 2024-11-09 18:00:40 +00:00

Match lock option name to TF CLI

This commit is contained in:
marcin.suterski 2017-05-11 12:40:08 -04:00
parent 73851ed5d8
commit 346612f2fa
No known key found for this signature in database
GPG Key ID: A6CF8B51D99C0C92

View File

@ -31,7 +31,7 @@ type (
InitOptions struct { InitOptions struct {
BackendConfig string `json:"backend-config"` BackendConfig string `json:"backend-config"`
Lock *bool `json:"lock-state"` Lock *bool `json:"lock"`
LockTimeout string `json:"lock-timeout"` LockTimeout string `json:"lock-timeout"`
} }
@ -125,12 +125,12 @@ func initCommand(config InitOptions) *exec.Cmd {
args = append(args, fmt.Sprintf("-backend-config=%s", config.BackendConfig)) args = append(args, fmt.Sprintf("-backend-config=%s", config.BackendConfig))
} }
// False is default // True is default in TF
if config.Lock != nil { if config.Lock != nil {
args = append(args, fmt.Sprintf("-lock=%t", *config.Lock)) args = append(args, fmt.Sprintf("-lock=%t", *config.Lock))
} }
// "0s" is default // "0s" is default in TF
if config.LockTimeout != "" { if config.LockTimeout != "" {
args = append(args, fmt.Sprintf("-lock-timeout=%s", config.LockTimeout)) args = append(args, fmt.Sprintf("-lock-timeout=%s", config.LockTimeout))
} }