From c21958557c22cf1aa98a71af1187b1b5a066e0e5 Mon Sep 17 00:00:00 2001 From: yxxhero <11087727+yxxhero@users.noreply.github.com> Date: Tue, 7 Mar 2023 08:21:13 +0800 Subject: [PATCH] fix: improve set and values flags help message (#724) Signed-off-by: yxxhero --- cmd/apply.go | 4 ++-- cmd/charts.go | 4 ++-- cmd/diff.go | 4 ++-- cmd/lint.go | 4 ++-- cmd/sync.go | 4 ++-- cmd/template.go | 4 ++-- cmd/write-values.go | 4 ++-- pkg/config/charts.go | 4 ++-- 8 files changed, 16 insertions(+), 16 deletions(-) diff --git a/cmd/apply.go b/cmd/apply.go index d6873076..aa3cb48d 100644 --- a/cmd/apply.go +++ b/cmd/apply.go @@ -33,8 +33,8 @@ func NewApplyCmd(globalCfg *config.GlobalImpl) *cobra.Command { } f := cmd.Flags() - f.StringArrayVar(&applyOptions.Set, "set", nil, "additional values to be merged into the command") - f.StringArrayVar(&applyOptions.Values, "values", nil, "additional value files to be merged into the command") + f.StringArrayVar(&applyOptions.Set, "set", nil, "additional values to be merged into the helm command --set flag") + f.StringArrayVar(&applyOptions.Values, "values", nil, "additional value files to be merged into the helm command --values flag") f.IntVar(&applyOptions.Concurrency, "concurrency", 0, "maximum number of concurrent helm processes to run, 0 is unlimited") f.BoolVar(&applyOptions.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 list of available API versions") f.IntVar(&applyOptions.Context, "context", 0, "output NUM lines of context around changes") diff --git a/cmd/charts.go b/cmd/charts.go index 1763f813..cae9d168 100644 --- a/cmd/charts.go +++ b/cmd/charts.go @@ -33,8 +33,8 @@ func NewChartsCmd(globalCfg *config.GlobalImpl) *cobra.Command { f := cmd.Flags() f.StringVar(&globalCfg.GlobalOptions.Args, "args", "", "pass args to helm exec") - f.StringArrayVar(&chartsOptions.Set, "set", nil, "additional values to be merged into the command") - f.StringArrayVar(&chartsOptions.Values, "values", nil, "additional value files to be merged into the command") + f.StringArrayVar(&chartsOptions.Set, "set", nil, "additional values to be merged into the helm command --set flag") + f.StringArrayVar(&chartsOptions.Values, "values", nil, "additional value files to be merged into the helm command --values flag") f.IntVar(&chartsOptions.Concurrency, "concurrency", 0, "maximum number of concurrent helm processes to run, 0 is unlimited") return cmd diff --git a/cmd/diff.go b/cmd/diff.go index eccdbff8..3269f8cf 100644 --- a/cmd/diff.go +++ b/cmd/diff.go @@ -32,8 +32,8 @@ func NewDiffCmd(globalCfg *config.GlobalImpl) *cobra.Command { f := cmd.Flags() f.StringVar(&globalCfg.GlobalOptions.Args, "args", "", "pass args to helm diff") - f.StringArrayVar(&diffOptions.Set, "set", nil, "additional values to be merged into the command") - f.StringArrayVar(&diffOptions.Values, "values", nil, "additional value files to be merged into the command") + f.StringArrayVar(&diffOptions.Set, "set", nil, "additional values to be merged into the helm command --set flag") + f.StringArrayVar(&diffOptions.Values, "values", nil, "additional value files to be merged into the helm command --values flag") 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", 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`) diff --git a/cmd/lint.go b/cmd/lint.go index d928adfd..4b9339bc 100644 --- a/cmd/lint.go +++ b/cmd/lint.go @@ -34,8 +34,8 @@ func NewLintCmd(globalCfg *config.GlobalImpl) *cobra.Command { f.IntVar(&lintOptions.Concurrency, "concurrency", 0, "maximum number of concurrent helm processes to run, 0 is unlimited") f.BoolVar(&lintOptions.SkipDeps, "skip-deps", false, `skip running "helm repo update" and "helm dependency build"`) f.StringVar(&globalCfg.GlobalOptions.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.StringArrayVar(&lintOptions.Set, "set", nil, "additional values to be merged into the helm command --set flag") + f.StringArrayVar(&lintOptions.Values, "values", nil, "additional value files to be merged into the helm command --values flag") 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.`) diff --git a/cmd/sync.go b/cmd/sync.go index fecb941d..037f58f1 100644 --- a/cmd/sync.go +++ b/cmd/sync.go @@ -32,8 +32,8 @@ func NewSyncCmd(globalCfg *config.GlobalImpl) *cobra.Command { f := cmd.Flags() f.StringVar(&globalCfg.GlobalOptions.Args, "args", "", "pass args to helm sync") - f.StringArrayVar(&syncOptions.Set, "set", nil, "additional values to be merged into the command") - f.StringArrayVar(&syncOptions.Values, "values", nil, "additional value files to be merged into the command") + f.StringArrayVar(&syncOptions.Set, "set", nil, "additional values to be merged into the helm command --set flag") + f.StringArrayVar(&syncOptions.Values, "values", nil, "additional value files to be merged into the helm command --values flag") 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", 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`) diff --git a/cmd/template.go b/cmd/template.go index c7a7933d..f9e5bea4 100644 --- a/cmd/template.go +++ b/cmd/template.go @@ -32,8 +32,8 @@ func NewTemplateCmd(globalCfg *config.GlobalImpl) *cobra.Command { f := cmd.Flags() f.StringVar(&globalCfg.GlobalOptions.Args, "args", "", "pass args to helm template") - f.StringArrayVar(&templateOptions.Set, "set", nil, "additional values to be merged into the command") - f.StringArrayVar(&templateOptions.Values, "values", nil, "additional value files to be merged into the command") + f.StringArrayVar(&templateOptions.Set, "set", nil, "additional values to be merged into the helm command --set flag") + f.StringArrayVar(&templateOptions.Values, "values", nil, "additional value files to be merged into the helm command --values flag") f.StringVar(&templateOptions.OutputDir, "output-dir", "", "output directory to pass to helm template (helm template --output-dir)") f.StringVar(&templateOptions.OutputDirTemplate, "output-dir-template", "", "go text template for generating the output directory. Default: {{ .OutputDir }}/{{ .State.BaseName }}-{{ .State.AbsPathSHA1 }}-{{ .Release.Name}}") f.IntVar(&templateOptions.Concurrency, "concurrency", 0, "maximum number of concurrent helm processes to run, 0 is unlimited") diff --git a/cmd/write-values.go b/cmd/write-values.go index b9eb5e55..974ad882 100644 --- a/cmd/write-values.go +++ b/cmd/write-values.go @@ -33,8 +33,8 @@ func NewWriteValuesCmd(globalCfg *config.GlobalImpl) *cobra.Command { f := cmd.Flags() f.IntVar(&writeValuesOptions.Concurrency, "concurrency", 0, "maximum number of concurrent helm processes to run, 0 is unlimited") f.BoolVar(&writeValuesOptions.SkipDeps, "skip-deps", false, `skip running "helm repo update" and "helm dependency build"`) - f.StringArrayVar(&writeValuesOptions.Set, "set", nil, "additional values to be merged into the command") - f.StringArrayVar(&writeValuesOptions.Values, "values", nil, "additional value files to be merged into the command") + f.StringArrayVar(&writeValuesOptions.Set, "set", nil, "additional values to be merged into the helm command --set flag") + f.StringArrayVar(&writeValuesOptions.Values, "values", nil, "additional value files to be merged into the helm command --values flag") f.StringVar(&writeValuesOptions.OutputFileTemplate, "output-file-template", "", "go text template for generating the output file. Default: {{ .State.BaseName }}-{{ .State.AbsPathSHA1 }}/{{ .Release.Name}}.yaml") return cmd diff --git a/pkg/config/charts.go b/pkg/config/charts.go index 7319c5ac..859894bc 100644 --- a/pkg/config/charts.go +++ b/pkg/config/charts.go @@ -3,9 +3,9 @@ package config // ChartsOptions is the options for the build command type ChartsOptions struct { - // Set is the additional values to be merged into the command + // Set is the additional values to be merged into the helm command --set flag Set []string - // Values is the additional value files to be merged into the command + // Values is the additional value files to be merged into the helm command --values flag Values []string // Concurrency is the maximum number of concurrent helm processes to run, 0 is unlimited Concurrency int