mirror of
https://github.com/thegeeklab/wp-opentofu.git
synced 2024-11-09 18:00:40 +00:00
Append vars to validate command
This commit is contained in:
parent
0ab0fed601
commit
0d1b8d291b
@ -77,7 +77,7 @@ func (p Plugin) Exec() error {
|
||||
commands = append(commands, initCommand(p.Config.InitOptions))
|
||||
|
||||
commands = append(commands, getModules())
|
||||
commands = append(commands, validateCommand())
|
||||
commands = append(commands, validateCommand(p.Config))
|
||||
commands = append(commands, planCommand(p.Config))
|
||||
if !p.Config.Plan {
|
||||
commands = append(commands, terraformCommand(p.Config))
|
||||
@ -173,10 +173,14 @@ func getModules() *exec.Cmd {
|
||||
)
|
||||
}
|
||||
|
||||
func validateCommand() *exec.Cmd {
|
||||
func validateCommand(config Config) *exec.Cmd {
|
||||
args := []string{
|
||||
"validate",
|
||||
}
|
||||
for k, v := range config.Vars {
|
||||
args = append(args, "-var")
|
||||
args = append(args, fmt.Sprintf("%s=%s", k, v))
|
||||
}
|
||||
return exec.Command(
|
||||
"terraform",
|
||||
args...,
|
||||
|
Loading…
Reference in New Issue
Block a user