mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-11-25 09:40:39 +00:00
include lock args on plan/apply/destroy
This commit is contained in:
parent
5ec5cfd699
commit
bd9b9abb02
18
plugin.go
18
plugin.go
@ -210,6 +210,12 @@ func planCommand(config Config) *exec.Cmd {
|
|||||||
if config.Parallelism > 0 {
|
if config.Parallelism > 0 {
|
||||||
args = append(args, fmt.Sprintf("-parallelism=%d", config.Parallelism))
|
args = append(args, fmt.Sprintf("-parallelism=%d", config.Parallelism))
|
||||||
}
|
}
|
||||||
|
if config.InitOptions.Lock != nil {
|
||||||
|
args = append(args, fmt.Sprintf("-lock=%t", *config.InitOptions.Lock))
|
||||||
|
}
|
||||||
|
if config.InitOptions.LockTimeout != "" {
|
||||||
|
args = append(args, fmt.Sprintf("-lock-timeout=%s", config.InitOptions.LockTimeout))
|
||||||
|
}
|
||||||
return exec.Command(
|
return exec.Command(
|
||||||
"terraform",
|
"terraform",
|
||||||
args...,
|
args...,
|
||||||
@ -234,6 +240,12 @@ func applyCommand(config Config) *exec.Cmd {
|
|||||||
if config.Parallelism > 0 {
|
if config.Parallelism > 0 {
|
||||||
args = append(args, fmt.Sprintf("-parallelism=%d", config.Parallelism))
|
args = append(args, fmt.Sprintf("-parallelism=%d", config.Parallelism))
|
||||||
}
|
}
|
||||||
|
if config.InitOptions.Lock != nil {
|
||||||
|
args = append(args, fmt.Sprintf("-lock=%t", *config.InitOptions.Lock))
|
||||||
|
}
|
||||||
|
if config.InitOptions.LockTimeout != "" {
|
||||||
|
args = append(args, fmt.Sprintf("-lock-timeout=%s", config.InitOptions.LockTimeout))
|
||||||
|
}
|
||||||
args = append(args, "plan.tfout")
|
args = append(args, "plan.tfout")
|
||||||
return exec.Command(
|
return exec.Command(
|
||||||
"terraform",
|
"terraform",
|
||||||
@ -251,6 +263,12 @@ func destroyCommand(config Config) *exec.Cmd {
|
|||||||
if config.Parallelism > 0 {
|
if config.Parallelism > 0 {
|
||||||
args = append(args, fmt.Sprintf("-parallelism=%d", config.Parallelism))
|
args = append(args, fmt.Sprintf("-parallelism=%d", config.Parallelism))
|
||||||
}
|
}
|
||||||
|
if config.InitOptions.Lock != nil {
|
||||||
|
args = append(args, fmt.Sprintf("-lock=%t", *config.InitOptions.Lock))
|
||||||
|
}
|
||||||
|
if config.InitOptions.LockTimeout != "" {
|
||||||
|
args = append(args, fmt.Sprintf("-lock-timeout=%s", config.InitOptions.LockTimeout))
|
||||||
|
}
|
||||||
args = append(args, "-force")
|
args = append(args, "-force")
|
||||||
return exec.Command(
|
return exec.Command(
|
||||||
"terraform",
|
"terraform",
|
||||||
|
Loading…
Reference in New Issue
Block a user