Don't panic when a map is included twice

If a map was included twice, we had side effects when skipping the extra
inclusion.

Bug: 340659219
Test: manual, TH
Change-Id: I90c55a800ecad932f8f67cf6f9f60dba571f7c48
This commit is contained in:
LaMont Jones
2024-05-14 15:53:37 -07:00
parent 8e2a6b1fe9
commit 05d59c5905

View File

@@ -439,7 +439,8 @@ func ReadReleaseConfigMaps(releaseConfigMapPaths StringList, targetRelease strin
configs := ReleaseConfigsFactory()
mapsRead := make(map[string]bool)
for idx, releaseConfigMapPath := range releaseConfigMapPaths {
var idx int
for _, releaseConfigMapPath := range releaseConfigMapPaths {
// Maintain an ordered list of release config directories.
configDir := filepath.Dir(releaseConfigMapPath)
if mapsRead[configDir] {
@@ -454,6 +455,7 @@ func ReadReleaseConfigMaps(releaseConfigMapPaths StringList, targetRelease strin
if err != nil {
return nil, err
}
idx += 1
}
// Now that we have all of the release config maps, can meld them and generate the artifacts.