diff --git a/cmd/apply.go b/cmd/apply.go index f67f5d79..e21ed0d6 100644 --- a/cmd/apply.go +++ b/cmd/apply.go @@ -42,9 +42,9 @@ func NewApplyCmd(globalCfg *config.GlobalImpl) *cobra.Command { f.BoolVar(&applyOptions.RetainValuesFiles, "retain-values-files", false, "DEPRECATED: Use skip-cleanup instead") f.BoolVar(&applyOptions.SkipCleanup, "skip-cleanup", false, "Stop cleaning up temporary values generated by helmfile and helm-secrets. Useful for debugging. Don't use in production for security") f.BoolVar(&applyOptions.SkipCRDs, "skip-crds", false, "if set, no CRDs will be installed on sync. By default, CRDs are installed if not already present") - f.BoolVar(&applyOptions.SkipNeeds, "skip-needs", false, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) - f.BoolVar(&applyOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`) - f.BoolVar(&applyOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) + f.BoolVar(&applyOptions.SkipNeeds, "skip-needs", true, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) + f.BoolVar(&applyOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided`) + f.BoolVar(&applyOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) f.BoolVar(&applyOptions.SkipDiffOnInstall, "skip-diff-on-install", false, "Skips running helm-diff on releases being newly installed on this apply. Useful when the release manifests are too huge to be reviewed, or it's too time-consuming to diff at all0") f.BoolVar(&applyOptions.IncludeTests, "include-tests", false, "enable the diffing of the helm test hooks") f.StringArrayVar(&applyOptions.Suppress, "suppress", nil, "suppress specified Kubernetes objects in the diff output. Can be provided multiple times. For example: --suppress KeycloakClient --suppress VaultSecret") diff --git a/cmd/diff.go b/cmd/diff.go index ce0737bf..b26e8b1a 100644 --- a/cmd/diff.go +++ b/cmd/diff.go @@ -36,10 +36,10 @@ func NewDiffCmd(globalCfg *config.GlobalImpl) *cobra.Command { f.StringArrayVar(&diffOptions.Values, "values", nil, "additional value files to be merged into the command") f.IntVar(&diffOptions.Concurrency, "concurrency", 0, "maximum number of concurrent helm processes to run, 0 is unlimited") f.BoolVar(&diffOptions.Validate, "validate", false, "validate your manifests against the Kubernetes cluster you are currently pointing at. Note that this requires access to a Kubernetes cluster to obtain information necessary for validating, like the diff of available API versions") - f.BoolVar(&diffOptions.SkipNeeds, "skip-needs", false, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) + f.BoolVar(&diffOptions.SkipNeeds, "skip-needs", true, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) f.BoolVar(&diffOptions.IncludeTests, "include-tests", false, "enable the diffing of the helm test hooks") - f.BoolVar(&diffOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`) - f.BoolVar(&diffOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) + f.BoolVar(&diffOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided`) + f.BoolVar(&diffOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) f.BoolVar(&diffOptions.SkipDeps, "skip-deps", false, `skip running "helm repo update" and "helm dependency build"`) f.BoolVar(&diffOptions.SkipDiffOnInstall, "skip-diff-on-install", false, "Skips running helm-diff on releases being newly installed on this apply. Useful when the release manifests are too huge to be reviewed, or it's too time-consuming to diff at all") f.BoolVar(&diffOptions.ShowSecrets, "show-secrets", false, "do not redact secret values in the output. should be used for debug purpose only") diff --git a/cmd/lint.go b/cmd/lint.go index 87fc6bb1..b6d64645 100644 --- a/cmd/lint.go +++ b/cmd/lint.go @@ -36,9 +36,9 @@ func NewLintCmd(globalCfg *config.GlobalImpl) *cobra.Command { f.StringVar(&lintOptions.Args, "args", "", "pass args to helm exec") f.StringArrayVar(&lintOptions.Set, "set", nil, "additional values to be merged into the command") f.StringArrayVar(&lintOptions.Values, "values", nil, "additional value files to be merged into the command") - f.BoolVar(&lintOptions.SkipNeeds, "skip-needs", false, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) - f.BoolVar(&lintOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`) - f.BoolVar(&lintOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) + f.BoolVar(&lintOptions.SkipNeeds, "skip-needs", true, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) + f.BoolVar(&lintOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided`) + f.BoolVar(&lintOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) return cmd } diff --git a/cmd/sync.go b/cmd/sync.go index 75cfff18..a1d4d4fc 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -36,10 +36,10 @@ func NewSyncCmd(globalCfg *config.GlobalImpl) *cobra.Command { f.StringArrayVar(&syncOptions.Values, "values", nil, "additional value files to be merged into the command") f.IntVar(&syncOptions.Concurrency, "concurrency", 0, "maximum number of concurrent helm processes to run, 0 is unlimited") f.BoolVar(&syncOptions.Validate, "validate", false, "validate your manifests against the Kubernetes cluster you are currently pointing at. Note that this requires access to a Kubernetes cluster to obtain information necessary for validating, like the sync of available API versions") - f.BoolVar(&syncOptions.SkipNeeds, "skip-needs", false, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) + f.BoolVar(&syncOptions.SkipNeeds, "skip-needs", true, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) f.BoolVar(&syncOptions.SkipCRDs, "skip-crds", false, "if set, no CRDs will be installed on sync. By default, CRDs are installed if not already present") - f.BoolVar(&syncOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`) - f.BoolVar(&syncOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) + f.BoolVar(&syncOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided`) + f.BoolVar(&syncOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) f.BoolVar(&syncOptions.SkipDeps, "skip-deps", false, `skip running "helm repo update" and "helm dependency build"`) f.BoolVar(&syncOptions.Wait, "wait", false, `Override helmDefaults.wait setting "helm upgrade --install --wait"`) f.BoolVar(&syncOptions.WaitForJobs, "wait-for-jobs", false, `Override helmDefaults.waitForJobs setting "helm upgrade --install --wait-for-jobs"`) diff --git a/cmd/template.go b/cmd/template.go index 02f13b6f..e75a74e4 100644 --- a/cmd/template.go +++ b/cmd/template.go @@ -40,9 +40,9 @@ func NewTemplateCmd(globalCfg *config.GlobalImpl) *cobra.Command { f.BoolVar(&templateOptions.Validate, "validate", false, "validate your manifests against the Kubernetes cluster you are currently pointing at. Note that this requires access to a Kubernetes cluster to obtain information necessary for validating, like the template of available API versions") f.BoolVar(&templateOptions.IncludeCRDs, "include-crds", false, "include CRDs in the templated output") f.BoolVar(&templateOptions.SkipTests, "skip-tests", false, "skip tests from templated output") - f.BoolVar(&templateOptions.SkipNeeds, "skip-needs", false, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) - f.BoolVar(&templateOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when when --selector/-l flag is not provided`) - f.BoolVar(&templateOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) + f.BoolVar(&templateOptions.SkipNeeds, "skip-needs", true, `do not automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided. Defaults to true when --include-needs or --include-transitive-needs is not provided`) + f.BoolVar(&templateOptions.IncludeNeeds, "include-needs", false, `automatically include releases from the target release's "needs" when --selector/-l flag is provided. Does nothing when --selector/-l flag is not provided`) + f.BoolVar(&templateOptions.IncludeTransitiveNeeds, "include-transitive-needs", false, `like --include-needs, but also includes transitive needs (needs of needs). Does nothing when --selector/-l flag is not provided. Overrides exclusions of other selectors and conditions.`) f.BoolVar(&templateOptions.SkipDeps, "skip-deps", false, `skip running "helm repo update" and "helm dependency build"`) f.BoolVar(&templateOptions.SkipCleanup, "skip-cleanup", false, "Stop cleaning up temporary values generated by helmfile and helm-secrets. Useful for debugging. Don't use in production for security") diff --git a/pkg/config/apply.go b/pkg/config/apply.go index a31d4031..27865cfb 100644 --- a/pkg/config/apply.go +++ b/pkg/config/apply.go @@ -112,7 +112,7 @@ func (a *ApplyImpl) DiffOutput() string { // IncludeNeeds returns the include needs. func (a *ApplyImpl) IncludeNeeds() bool { - return a.ApplyOptions.IncludeNeeds || a.ApplyOptions.IncludeTransitiveNeeds + return a.ApplyOptions.IncludeNeeds || a.IncludeTransitiveNeeds() } // IncludeTests returns the include tests. @@ -157,7 +157,7 @@ func (a *ApplyImpl) SkipDiffOnInstall() bool { // SkipNeeds returns the skip needs. func (a *ApplyImpl) SkipNeeds() bool { - if !a.ApplyOptions.IncludeNeeds { + if !a.IncludeNeeds() { return a.ApplyOptions.SkipNeeds } return false diff --git a/pkg/config/diff.go b/pkg/config/diff.go index 56f3a892..de0a6336 100644 --- a/pkg/config/diff.go +++ b/pkg/config/diff.go @@ -69,7 +69,7 @@ func (t *DiffImpl) Concurrency() int { // IncludeNeeds returns the include needs func (t *DiffImpl) IncludeNeeds() bool { - return t.DiffOptions.IncludeNeeds || t.DiffOptions.IncludeTransitiveNeeds + return t.DiffOptions.IncludeNeeds || t.IncludeTransitiveNeeds() } // IncludeTransitiveNeeds returns the include transitive needs @@ -89,7 +89,7 @@ func (t *DiffImpl) SkipDeps() bool { // SkipNeeds returns the skip needs func (t *DiffImpl) SkipNeeds() bool { - if !t.DiffOptions.IncludeNeeds { + if !t.IncludeNeeds() { return t.DiffOptions.SkipNeeds } diff --git a/pkg/config/global.go b/pkg/config/global.go index 5fa34837..fa511472 100644 --- a/pkg/config/global.go +++ b/pkg/config/global.go @@ -135,7 +135,7 @@ func (g *GlobalImpl) Color() bool { } // We replicate the helm-diff behavior in helmfile - // because when when helmfile calls helm-diff, helm-diff has no access to term and therefore + // because when helmfile calls helm-diff, helm-diff has no access to term and therefore // we can't rely on helm-diff's ability to auto-detect term for color output. // See https://github.com/roboll/helmfile/issues/2043 diff --git a/pkg/config/lint.go b/pkg/config/lint.go index 17d1c299..45ea0973 100644 --- a/pkg/config/lint.go +++ b/pkg/config/lint.go @@ -72,7 +72,7 @@ func (l *LintImpl) SkipCleanup() bool { // IncludeNeeds returns the include needs func (l *LintImpl) IncludeNeeds() bool { - return l.LintOptions.IncludeNeeds || l.LintOptions.IncludeTransitiveNeeds + return l.LintOptions.IncludeNeeds || l.IncludeTransitiveNeeds() } // IncludeTransitiveNeeds returns the include transitive needs @@ -82,7 +82,7 @@ func (l *LintImpl) IncludeTransitiveNeeds() bool { // SkipNeeds returns the skip needs func (l *LintImpl) SkipNeeds() bool { - if !l.LintOptions.IncludeNeeds { + if !l.IncludeNeeds() { return l.LintOptions.SkipNeeds } diff --git a/pkg/config/sync.go b/pkg/config/sync.go index 61569710..0a9178f5 100644 --- a/pkg/config/sync.go +++ b/pkg/config/sync.go @@ -61,7 +61,7 @@ func (t *SyncImpl) Concurrency() int { // IncludeNeeds returns the include needs func (t *SyncImpl) IncludeNeeds() bool { - return t.SyncOptions.IncludeNeeds || t.SyncOptions.IncludeTransitiveNeeds + return t.SyncOptions.IncludeNeeds || t.IncludeTransitiveNeeds() } // IncludeTransitiveNeeds returns the include transitive needs @@ -81,7 +81,7 @@ func (t *SyncImpl) SkipDeps() bool { // SkipNeeds returns the skip needs func (t *SyncImpl) SkipNeeds() bool { - if !t.SyncOptions.IncludeNeeds { + if !t.IncludeNeeds() { return t.SyncOptions.SkipNeeds } diff --git a/pkg/config/template.go b/pkg/config/template.go index 21d7bb8d..5810a86b 100644 --- a/pkg/config/template.go +++ b/pkg/config/template.go @@ -74,7 +74,7 @@ func (t *TemplateImpl) IncludeCRDs() bool { // IncludeNeeds returns the include needs func (t *TemplateImpl) IncludeNeeds() bool { - return t.TemplateOptions.IncludeNeeds || t.TemplateOptions.IncludeTransitiveNeeds + return t.TemplateOptions.IncludeNeeds || t.IncludeTransitiveNeeds() } // IncludeTransitiveNeeds returns the include transitive needs @@ -109,7 +109,7 @@ func (t *TemplateImpl) SkipDeps() bool { // SkipNeeds returns the skip needs func (t *TemplateImpl) SkipNeeds() bool { - if !t.TemplateOptions.IncludeNeeds { + if !t.IncludeNeeds() { return t.TemplateOptions.SkipNeeds }