1
0
mirror of synced 2026-02-06 19:05:55 +00:00

Add support for multiple values files to create hr

Signed-off-by: Stefan Prodan <stefan.prodan@gmail.com>
This commit is contained in:
Stefan Prodan
2021-02-05 15:12:29 +02:00
parent 5416c19b2e
commit 3dd574ee51
3 changed files with 57 additions and 14 deletions

View File

@@ -393,3 +393,24 @@ func ValidateComponents(components []string) error {
return nil
}
// TODO(stefan): move this to fluxcd/pkg
// taken from: https://github.com/fluxcd/helm-controller/blob/main/internal/util/util.go
func MergeMaps(a, b map[string]interface{}) map[string]interface{} {
out := make(map[string]interface{}, len(a))
for k, v := range a {
out[k] = v
}
for k, v := range b {
if v, ok := v.(map[string]interface{}); ok {
if bv, ok := out[k]; ok {
if bv, ok := bv.(map[string]interface{}); ok {
out[k] = MergeMaps(bv, v)
continue
}
}
}
out[k] = v
}
return out
}