Skip to content

Commit

Permalink
Need to be able to template filenames on yamlOverlay (#580)
Browse files Browse the repository at this point in the history
This is to match behavior in other update/create specs
  • Loading branch information
michaeljguarino authored Dec 10, 2024
1 parent 26a9084 commit 74f87f4
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/pr/updates.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,13 @@ func processYamlOverlays(overlays []YamlOverlay, ctx map[string]interface{}) err
return mergeYaml(data, overlayYaml, overlay.ListMerge)
}

if err = replaceInPlace(overlay.File, mergeFunc); err != nil {
fileName := overlay.File
templated, err := templateReplacement([]byte(fileName), ctx)
if err == nil {
fileName = string(templated)
}

if err = replaceInPlace(fileName, mergeFunc); err != nil {
return err
}
}
Expand Down

0 comments on commit 74f87f4

Please sign in to comment.