fix: persist scheduler-k3s chart overrides as JSON maps

Chart property names containing `/` failed because per-key flat-file storage interpreted the slash as a filesystem path separator, and any move to line-based storage would silently truncate multi-line values. A new `PropertyMap*` helper family in `common` persists each map as a single JSON file so both `/` in keys and `\n` in values round-trip losslessly. Chart overrides move to `chart-overrides.<chart>` and an idempotent `TriggerInstall` migration rewrites any legacy `chart.<chart>.<key>` files into the new layout. The deprecated `scheduler-k3s:set --global chart.*` form is rerouted through the same map storage so it does not silently orphan writes. Closes #8717.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-05-31 01:54:28 -04:00
1 parent ff00bcb218
commit b8929712d4
11 files changed
+488 -22

No files matched your search

+11 -8
View File
@@ -105,14 +105,17 @@ func ReportSingleApp(appName string, format string, infoFlag string) error {
}
}
chartProperties, err := common.PropertyGetAllByPrefix("scheduler-k3s", "--global", "chart.")
if err != nil {
return fmt.Errorf("Unable to get property list: %w", err)
}
for name, value := range chartProperties {
flagName := "--scheduler-k3s-global-" + name
flags[flagName] = func(appName string) string {
return value
for _, chart := range HelmCharts {
chartOverrides, err := common.PropertyMapGet("scheduler-k3s", "--global", "chart-overrides."+chart.ReleaseName)
if err != nil {
return fmt.Errorf("Unable to get property list: %w", err)
}
for key, value := range chartOverrides {
flagName := fmt.Sprintf("--scheduler-k3s-global-chart.%s.%s", chart.ReleaseName, key)
value := value
flags[flagName] = func(appName string) string {
return value
}
}
}