Skip to content

Commit

Permalink
Reorganize code to avoid unnecessary loop
Browse files Browse the repository at this point in the history
  • Loading branch information
fabianvf committed Jul 2, 2020
1 parent 9591bfe commit 1dae72e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pkg/ansible/runner/runner.go
Original file line number Diff line number Diff line change
Expand Up @@ -310,12 +310,13 @@ func (r *runner) makeParameters(u *unstructured.Unstructured) map[string]interfa
}

parameters := map[string]interface{}{}
for k, v := range spec {
parameters[k] = v
}

if r.snakeCaseParameters {
parameters = paramconv.MapToSnake(spec)
} else {
for k, v := range spec {
parameters[k] = v
}
}

parameters["meta"] = map[string]string{"namespace": u.GetNamespace(), "name": u.GetName()}
Expand Down

0 comments on commit 1dae72e

Please sign in to comment.