Skip to content

Commit

Permalink
internal/helm: fix bug in helm keys that had a .
Browse files Browse the repository at this point in the history
Since in YAML dots are used to represent a path, when converting helm
values into a string representation YAML keys that had dots were wrongly
represented. This commit escapes the dots to correctly represent the
helm keys.

Signed-off-by: André Martins <[email protected]>
  • Loading branch information
aanm committed Apr 5, 2022
1 parent 7840be0 commit e5feec3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ func valuesToString(prevKey string, b map[string]interface{}) string {
continue
}
if prevKey != "" {
if strings.Contains(k, ".") {
k = strings.ReplaceAll(k, ".", `\\.`)
}
out = append(out, fmt.Sprintf("%s.%s=%v", prevKey, k, v))
} else {
out = append(out, fmt.Sprintf("%s=%v", k, v))
Expand Down

0 comments on commit e5feec3

Please sign in to comment.