Skip to content

Commit

Permalink
Handle types of exec_provider_config args and env properly (#145)
Browse files Browse the repository at this point in the history
  • Loading branch information
pib authored Feb 26, 2022
1 parent 647debc commit 54f22a9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions argocd/structure_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@ func expandClusterConfig(config interface{}) (
clusterConfig.ExecProviderConfig.APIVersion = v.(string)
}
if k == "args" {
clusterConfig.ExecProviderConfig.Args = v.([]string)
argsI := v.([]interface{})
for _, argI := range argsI {
clusterConfig.ExecProviderConfig.Args = append(clusterConfig.ExecProviderConfig.Args, argI.(string))
}
}
if k == "command" {
clusterConfig.ExecProviderConfig.Command = v.(string)
Expand All @@ -101,7 +104,11 @@ func expandClusterConfig(config interface{}) (
clusterConfig.ExecProviderConfig.InstallHint = v.(string)
}
if k == "env" {
clusterConfig.ExecProviderConfig.Env = v.(map[string]string)
clusterConfig.ExecProviderConfig.Env = make(map[string]string)
envI := v.(map[string]interface{})
for key, val := range envI {
clusterConfig.ExecProviderConfig.Env[key] = val.(string)
}
}
}
}
Expand Down

0 comments on commit 54f22a9

Please sign in to comment.