Skip to content

Commit

Permalink
[installer]: escape inline yaml keys for labels/annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Emms committed Aug 10, 2022
1 parent 5855038 commit 0bc9b87
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions install/installer/pkg/helm/helm.go
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,9 @@ func CustomizeAnnotation(registryValues []string, prefix string, ctx *common.Ren
annotations := common.CustomizeAnnotation(ctx, component, typeMeta, existingAnnotations...)
if len(annotations) > 0 {
for k, v := range annotations {
registryValues = append(registryValues, KeyValue(fmt.Sprintf("%s.%s", prefix, k), v))
// Escape any dots in the keys so they're not expanded
key := strings.Replace(k, ".", "\\.", -1)
registryValues = append(registryValues, KeyValue(fmt.Sprintf("%s.%s", prefix, key), v))
}
}

Expand All @@ -236,7 +238,9 @@ func CustomizeLabel(registryValues []string, prefix string, ctx *common.RenderCo

if len(labels) > 0 {
for k, v := range labels {
registryValues = append(registryValues, KeyValue(fmt.Sprintf("%s.%s", prefix, k), v))
// Escape any dots in the keys so they're not expanded
key := strings.Replace(k, ".", "\\.", -1)
registryValues = append(registryValues, KeyValue(fmt.Sprintf("%s.%s", prefix, key), v))
}
}

Expand Down

0 comments on commit 0bc9b87

Please sign in to comment.