From 05582483b2d1abf0614c7c9a048b62774b556cec Mon Sep 17 00:00:00 2001 From: Joe Julian Date: Wed, 16 Aug 2023 08:55:18 -0700 Subject: [PATCH] Revert "add --extra-helm-args to ct lint (#552)" This reverts commit 0d4ab8035a85db216c460a30e20cb5a03892c786. --- ct/cmd/install.go | 3 +++ ct/cmd/lint.go | 28 ++++++++++++++-------------- ct/cmd/root.go | 3 --- doc/ct_install.md | 2 +- doc/ct_lint-and-install.md | 2 +- doc/ct_lint.md | 2 -- pkg/tool/helm.go | 2 +- 7 files changed, 20 insertions(+), 22 deletions(-) diff --git a/ct/cmd/install.go b/ct/cmd/install.go index 734ea079..96523f3c 100644 --- a/ct/cmd/install.go +++ b/ct/cmd/install.go @@ -61,6 +61,9 @@ 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 71e86810..c5b015cc 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 de8223b4..5ec6fd2b 100644 --- a/ct/cmd/root.go +++ b/ct/cmd/root.go @@ -95,9 +95,6 @@ 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 79517855..618a440c 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 73d13fe0..78df969a 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 f35ee02a..ec73f229 100644 --- a/doc/ct_lint.md +++ b/doc/ct_lint.md @@ -53,8 +53,6 @@ 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 f057ad42..a0f7850d 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, h.extraArgs) + return h.exec.RunProcess("helm", "lint", chart, values) } func (h Helm) InstallWithValues(chart string, valuesFile string, namespace string, release string) error {