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

Update pkg/runtime to v0.8.2

pkg/runtime v0.8.2 introduces runtime/transform which includes
`MergeMaps`:
https://github.com/fluxcd/pkg/pull/85

Signed-off-by: Dylan Arbour <arbourd@users.noreply.github.com>
This commit is contained in:
Dylan Arbour
2021-02-15 18:05:36 -05:00
parent 298d6a1a15
commit 99002f92f4
4 changed files with 5 additions and 23 deletions

View File

@@ -367,27 +367,6 @@ 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
}
// CompatibleVersion returns if the provided binary version is compatible
// with the given target version. At present, this is true if the target
// version is equal to the MINOR range of the binary, or if the binary