feat: add a whole-set form and clear for chart overrides

The `scheduler-k3s:charts:set` command only changed one chart override at a time, so matching a chart's stored overrides to a declared set meant reading the report, computing the difference in both directions and issuing one command per added, changed and removed property, with a failure partway through leaving a mixture of the two sets. A `--replace` flag on `scheduler-k3s:charts:set` now takes a chart name followed by `property=value` pairs and writes the declared map for that chart in a single call. Every pair is parsed before anything is written, so a rejected pair leaves the stored overrides untouched, and a pair ending in `=` stores an empty value, which the per-property form cannot express. An empty pair list is rejected rather than treated as a request to remove everything, and the new `scheduler-k3s:charts:clear` command handles that case by removing every override for a chart.
This commit is contained in:
Jose Diaz-Gonzalez committed 2026-10-24 19:34:13 -04:00
1 parent be291f3928
commit 00c3e48cf4
10 files changed
+278 -42

No files matched your search

+14
View File
@@ -820,6 +820,20 @@ func getComputedDeployTimeout(appName string) string {
return deployTimeout
}
// getHelmChart returns the helm chart managed by dokku with the given release name
func getHelmChart(chartName string) (HelmChart, error) {
knownCharts := []string{}
for _, chart := range HelmCharts {
if chart.ReleaseName == chartName {
return chart, nil
}
knownCharts = append(knownCharts, chart.ReleaseName)
}
sort.Strings(knownCharts)
return HelmChart{}, fmt.Errorf("Invalid chart name %q, valid charts: %s", chartName, strings.Join(knownCharts, ", "))
}
func getImagePullSecrets(appName string) string {
return common.PropertyGet("scheduler-k3s", appName, "image-pull-secrets")
}