From 2835cc9be311c2797b633c617895d400a63c1e07 Mon Sep 17 00:00:00 2001 From: yxxhero Date: Wed, 16 Apr 2025 08:36:55 +0800 Subject: [PATCH] fix more issues Signed-off-by: yxxhero --- pkg/state/state.go | 12 ++++++------ .../issue_2098_release_template_needs/output.yaml | 6 ------ 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/pkg/state/state.go b/pkg/state/state.go index e72ad360..b167fa88 100644 --- a/pkg/state/state.go +++ b/pkg/state/state.go @@ -204,13 +204,13 @@ type HelmSpec struct { // PlainHttp is true if the remote charte should be fetched using HTTP and not HTTPS PlainHttp bool `yaml:"plainHttp,omitempty"` // Wait, if set to true, will wait until all resources are deleted before mark delete command as successful - DeleteWait bool `yaml:"deleteWait"` + DeleteWait bool `yaml:"deleteWait,omitempty"` // Timeout is the time in seconds to wait for helmfile delete command (default 300) - DeleteTimeout int `yaml:"deleteTimeout"` + DeleteTimeout int `yaml:"deleteTimeout,omitempty"` // SyncReleaseLabels is true if the release labels should be synced with the helmfile labels - SyncReleaseLabels *bool `yaml:"syncReleaseLabels"` + SyncReleaseLabels *bool `yaml:"syncReleaseLabels,omitempty"` // TakeOwnership is true if the helmfile should take ownership of the release - TakeOwnership *bool `yaml:"takeOwnership"` + TakeOwnership *bool `yaml:"takeOwnership,omitempty"` } // RepositorySpec that defines values for a helm repo @@ -414,9 +414,9 @@ type ReleaseSpec struct { // Timeout is the time in seconds to wait for helmfile delete command (default 300) DeleteTimeout *int `yaml:"deleteTimeout,omitempty"` // SyncReleaseLabels is true if the release labels should be synced with the helmfile labels - SyncReleaseLabels *bool `yaml:"syncReleaseLabels"` + SyncReleaseLabels *bool `yaml:"syncReleaseLabels,omitempty"` // TakeOwnership is true if the release should take ownership of the resources - TakeOwnership *bool `yaml:"takeOwnership"` + TakeOwnership *bool `yaml:"takeOwnership,omitempty"` } func (r *Inherits) UnmarshalYAML(unmarshal func(any) error) error { diff --git a/test/e2e/template/helmfile/testdata/snapshot/issue_2098_release_template_needs/output.yaml b/test/e2e/template/helmfile/testdata/snapshot/issue_2098_release_template_needs/output.yaml index 71cb3274..25dd4428 100644 --- a/test/e2e/template/helmfile/testdata/snapshot/issue_2098_release_template_needs/output.yaml +++ b/test/e2e/template/helmfile/testdata/snapshot/issue_2098_release_template_needs/output.yaml @@ -19,8 +19,6 @@ releases: name: default-shared-resources namespace: default service: shared-resources - syncReleaseLabels: false - takeOwnership: false - chart: aservo/util version: 0.0.1 needs: @@ -32,12 +30,8 @@ releases: name: default-release-resources namespace: default service: release-resources - syncReleaseLabels: false - takeOwnership: false templates: defaults: name: default-{{ .Release.Labels.service }} namespace: default - syncReleaseLabels: false - takeOwnership: false renderedvalues: {}