|
|
@ -18,7 +18,7 @@ package util
|
|
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"fmt"
|
|
|
|
"log"
|
|
|
|
"log/slog"
|
|
|
|
"maps"
|
|
|
|
"maps"
|
|
|
|
|
|
|
|
|
|
|
|
"github.com/mitchellh/copystructure"
|
|
|
|
"github.com/mitchellh/copystructure"
|
|
|
@ -47,7 +47,7 @@ func CoalesceValues(chrt *chart.Chart, vals map[string]interface{}) (Values, err
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return vals, err
|
|
|
|
return vals, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return coalesce(log.Printf, chrt, valsCopy, "", false)
|
|
|
|
return coalesce(slog.Warn, chrt, valsCopy, "", false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// MergeValues is used to merge the values in a chart and its subcharts. This
|
|
|
|
// MergeValues is used to merge the values in a chart and its subcharts. This
|
|
|
@ -69,7 +69,7 @@ func MergeValues(chrt *chart.Chart, vals map[string]interface{}) (Values, error)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return vals, err
|
|
|
|
return vals, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return coalesce(log.Printf, chrt, valsCopy, "", true)
|
|
|
|
return coalesce(slog.Warn, chrt, valsCopy, "", true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func copyValues(vals map[string]interface{}) (Values, error) {
|
|
|
|
func copyValues(vals map[string]interface{}) (Values, error) {
|
|
|
@ -263,11 +263,11 @@ func childChartMergeTrue(chrt *chart.Chart, key string, merge bool) bool {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// dest is considered authoritative.
|
|
|
|
// dest is considered authoritative.
|
|
|
|
func CoalesceTables(dst, src map[string]interface{}) map[string]interface{} {
|
|
|
|
func CoalesceTables(dst, src map[string]interface{}) map[string]interface{} {
|
|
|
|
return coalesceTablesFullKey(log.Printf, dst, src, "", false)
|
|
|
|
return coalesceTablesFullKey(slog.Warn, dst, src, "", false)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func MergeTables(dst, src map[string]interface{}) map[string]interface{} {
|
|
|
|
func MergeTables(dst, src map[string]interface{}) map[string]interface{} {
|
|
|
|
return coalesceTablesFullKey(log.Printf, dst, src, "", true)
|
|
|
|
return coalesceTablesFullKey(slog.Warn, dst, src, "", true)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// coalesceTablesFullKey merges a source map into a destination map.
|
|
|
|
// coalesceTablesFullKey merges a source map into a destination map.
|
|
|
@ -300,7 +300,7 @@ func coalesceTablesFullKey(printf printFn, dst, src map[string]interface{}, pref
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
printf("warning: cannot overwrite table with non table for %s (%v)", fullkey, val)
|
|
|
|
printf("warning: cannot overwrite table with non table for %s (%v)", fullkey, val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if istable(dv) && val != nil {
|
|
|
|
} else if istable(dv) && val != nil && isNonEmptyString(val) && isNonEmptyTable(dv) {
|
|
|
|
printf("warning: destination for %s is a table. Ignoring non-table value (%v)", fullkey, val)
|
|
|
|
printf("warning: destination for %s is a table. Ignoring non-table value (%v)", fullkey, val)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|