diff --git a/ct/cmd/install.go b/ct/cmd/install.go index 96523f3c..734ea079 100644 --- a/ct/cmd/install.go +++ b/ct/cmd/install.go @@ -61,9 +61,6 @@ func addInstallFlags(flags *flag.FlagSet) { An optional, arbitrary identifier that is added to the name of the namespace a chart is installed into. In a CI environment, this could be the build number or the ID of a pull request. If not specified, the name of the chart is used`)) - flags.String("helm-extra-args", "", heredoc.Doc(` - Additional arguments for Helm. Must be passed as a single quoted string - (e.g. "--timeout 500s"`)) flags.Bool("upgrade", false, heredoc.Doc(` Whether to test an in-place upgrade of each chart from its previous revision if the current version should not introduce a breaking change according to the SemVer spec`)) diff --git a/ct/cmd/lint.go b/ct/cmd/lint.go index c5b015cc..71e86810 100644 --- a/ct/cmd/lint.go +++ b/ct/cmd/lint.go @@ -54,26 +54,26 @@ func newLintCmd() *cobra.Command { func addLintFlags(flags *flag.FlagSet) { flags.String("lint-conf", "", heredoc.Doc(` - The config file for YAML linting. If not specified, 'lintconf.yaml' - is searched in the current directory, '$HOME/.ct', and '/etc/ct', in - that order`)) + The config file for YAML linting. If not specified, 'lintconf.yaml' + is searched in the current directory, '$HOME/.ct', and '/etc/ct', in + that order`)) flags.String("chart-yaml-schema", "", heredoc.Doc(` - The schema for chart.yml validation. If not specified, 'chart_schema.yaml' - is searched in the current directory, '$HOME/.ct', and '/etc/ct', in - that order.`)) + The schema for chart.yml validation. If not specified, 'chart_schema.yaml' + is searched in the current directory, '$HOME/.ct', and '/etc/ct', in + that order.`)) flags.Bool("validate-maintainers", true, heredoc.Doc(` - Enable validation of maintainer account names in chart.yml. - Works for GitHub, GitLab, and Bitbucket`)) + Enable validation of maintainer account names in chart.yml. + Works for GitHub, GitLab, and Bitbucket`)) flags.Bool("check-version-increment", true, "Activates a check for chart version increments") flags.Bool("validate-chart-schema", true, heredoc.Doc(` - Enable schema validation of 'Chart.yaml' using Yamale`)) + Enable schema validation of 'Chart.yaml' using Yamale`)) flags.Bool("validate-yaml", true, heredoc.Doc(` - Enable linting of 'Chart.yaml' and values files`)) + Enable linting of 'Chart.yaml' and values files`)) flags.StringSlice("additional-commands", []string{}, heredoc.Doc(` - Additional commands to run per chart (default: []) - Commands will be executed in the same order as provided in the list and will - be rendered with go template before being executed. - Example: "helm unittest --helm3 -f tests/*.yaml {{ .Path }}"`)) + Additional commands to run per chart (default: []) + Commands will be executed in the same order as provided in the list and will + be rendered with go template before being executed. + Example: "helm unittest --helm3 -f tests/*.yaml {{ .Path }}"`)) } func lint(cmd *cobra.Command, _ []string) error { diff --git a/ct/cmd/root.go b/ct/cmd/root.go index 5ec6fd2b..de8223b4 100644 --- a/ct/cmd/root.go +++ b/ct/cmd/root.go @@ -95,6 +95,9 @@ func addCommonLintAndInstallFlags(flags *pflag.FlagSet) { Additional chart repositories for dependency resolutions. Repositories should be formatted as 'name=url' (ex: local=http://127.0.0.1:8879/charts). May be specified multiple times or separate values with commas`)) + flags.String("helm-extra-args", "", heredoc.Doc(` + Additional arguments for Helm. Must be passed as a single quoted string + (e.g. "--timeout 500s")`)) flags.StringSlice("helm-repo-extra-args", []string{}, heredoc.Doc(` Additional arguments for the 'helm repo add' command to be specified on a per-repo basis with an equals sign as delimiter diff --git a/doc/ct_install.md b/doc/ct_install.md index 618a440c..79517855 100644 --- a/doc/ct_install.md +++ b/doc/ct_install.md @@ -52,7 +52,7 @@ ct install [flags] for command output --helm-dependency-extra-args strings Additional arguments for 'helm dependency build' (e.g. ["--skip-refresh"] --helm-extra-args string Additional arguments for Helm. Must be passed as a single quoted string - (e.g. "--timeout 500s" + (e.g. "--timeout 500s") --helm-extra-set-args string Additional arguments for Helm. Must be passed as a single quoted string (e.g. "--set=name=value" --helm-repo-extra-args strings Additional arguments for the 'helm repo add' command to be diff --git a/doc/ct_lint-and-install.md b/doc/ct_lint-and-install.md index 78df969a..73d13fe0 100644 --- a/doc/ct_lint-and-install.md +++ b/doc/ct_lint-and-install.md @@ -44,7 +44,7 @@ ct lint-and-install [flags] for command output --helm-dependency-extra-args strings Additional arguments for 'helm dependency build' (e.g. ["--skip-refresh"] --helm-extra-args string Additional arguments for Helm. Must be passed as a single quoted string - (e.g. "--timeout 500s" + (e.g. "--timeout 500s") --helm-extra-set-args string Additional arguments for Helm. Must be passed as a single quoted string (e.g. "--set=name=value" --helm-repo-extra-args strings Additional arguments for the 'helm repo add' command to be diff --git a/doc/ct_lint.md b/doc/ct_lint.md index ec73f229..f35ee02a 100644 --- a/doc/ct_lint.md +++ b/doc/ct_lint.md @@ -53,6 +53,8 @@ ct lint [flags] --github-groups Change the delimiters for github to create collapsible groups for command output --helm-dependency-extra-args strings Additional arguments for 'helm dependency build' (e.g. ["--skip-refresh"] + --helm-extra-args string Additional arguments for Helm. Must be passed as a single quoted string + (e.g. "--timeout 500s") --helm-repo-extra-args strings Additional arguments for the 'helm repo add' command to be specified on a per-repo basis with an equals sign as delimiter (e.g. 'myrepo=--username test --password secret'). May be specified diff --git a/pkg/tool/helm.go b/pkg/tool/helm.go index e257126c..92e26e9c 100644 --- a/pkg/tool/helm.go +++ b/pkg/tool/helm.go @@ -52,7 +52,7 @@ func (h Helm) LintWithValues(chart string, valuesFile string) error { values = []string{"--values", valuesFile} } - return h.exec.RunProcess("helm", "lint", chart, values) + return h.exec.RunProcess("helm", "lint", chart, values, h.extraArgs) } func (h Helm) InstallWithValues(chart string, valuesFile string, namespace string, release string) error {