Skip to content

Commit 3282670

Browse files
fix(config): preserve HelmReleaseMaxHistory=0 across YAML marshal
HelmReleaseMaxHistory carried omitempty, so a value of 0 (which Helm treats as "unlimited") would be dropped on marshal and become indistinguishable from an unset field. The runtime path (start.go always populates it from --helmrelease-max-history) is safe today, but drop omitempty so the explicit "unlimited" intent survives if ReleaseConfig is ever serialized. Address review feedback from coderabbitai on config.go. Assisted-By: Claude <[email protected]> Signed-off-by: Myasnikov Daniil <[email protected]>
1 parent 32d2f11 commit 3282670

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

‎pkg/config/config.go‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,10 @@ type ReleaseConfig struct {
127127
HelmReleaseUpgradeTimeout time.Duration `yaml:"helmReleaseUpgradeTimeout,omitempty"`
128128
// HelmReleaseMaxHistory is the global default for Spec.MaxHistory.
129129
// 0 means unlimited per Helm semantics; matches the cozystack-operator
130-
// flag of the same name.
131-
HelmReleaseMaxHistory int `yaml:"helmReleaseMaxHistory,omitempty"`
130+
// flag of the same name. No omitempty: 0 ("unlimited") must survive a
131+
// round-trip distinct from an unset field if ReleaseConfig is ever
132+
// marshalled.
133+
HelmReleaseMaxHistory int `yaml:"helmReleaseMaxHistory"`
132134
}
133135

134136
// ChartRefConfig references a Flux source artifact for the Helm chart.

0 commit comments

Comments
 (0)