Skip to content

Commit 0d4ab80

Browse files
add --extra-helm-args to ct lint (#552)
Signed-off-by: AndersBennedsgaard <abbennedsgaard@gmail.com>
1 parent 585f1b3 commit 0d4ab80

7 files changed

Lines changed: 22 additions & 20 deletions

File tree

ct/cmd/install.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,9 +61,6 @@ func addInstallFlags(flags *flag.FlagSet) {
6161
An optional, arbitrary identifier that is added to the name of the namespace a
6262
chart is installed into. In a CI environment, this could be the build number or
6363
the ID of a pull request. If not specified, the name of the chart is used`))
64-
flags.String("helm-extra-args", "", heredoc.Doc(`
65-
Additional arguments for Helm. Must be passed as a single quoted string
66-
(e.g. "--timeout 500s"`))
6764
flags.Bool("upgrade", false, heredoc.Doc(`
6865
Whether to test an in-place upgrade of each chart from its previous revision if the
6966
current version should not introduce a breaking change according to the SemVer spec`))

ct/cmd/lint.go

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -54,26 +54,26 @@ func newLintCmd() *cobra.Command {
5454

5555
func addLintFlags(flags *flag.FlagSet) {
5656
flags.String("lint-conf", "", heredoc.Doc(`
57-
The config file for YAML linting. If not specified, 'lintconf.yaml'
58-
is searched in the current directory, '$HOME/.ct', and '/etc/ct', in
59-
that order`))
57+
The config file for YAML linting. If not specified, 'lintconf.yaml'
58+
is searched in the current directory, '$HOME/.ct', and '/etc/ct', in
59+
that order`))
6060
flags.String("chart-yaml-schema", "", heredoc.Doc(`
61-
The schema for chart.yml validation. If not specified, 'chart_schema.yaml'
62-
is searched in the current directory, '$HOME/.ct', and '/etc/ct', in
63-
that order.`))
61+
The schema for chart.yml validation. If not specified, 'chart_schema.yaml'
62+
is searched in the current directory, '$HOME/.ct', and '/etc/ct', in
63+
that order.`))
6464
flags.Bool("validate-maintainers", true, heredoc.Doc(`
65-
Enable validation of maintainer account names in chart.yml.
66-
Works for GitHub, GitLab, and Bitbucket`))
65+
Enable validation of maintainer account names in chart.yml.
66+
Works for GitHub, GitLab, and Bitbucket`))
6767
flags.Bool("check-version-increment", true, "Activates a check for chart version increments")
6868
flags.Bool("validate-chart-schema", true, heredoc.Doc(`
69-
Enable schema validation of 'Chart.yaml' using Yamale`))
69+
Enable schema validation of 'Chart.yaml' using Yamale`))
7070
flags.Bool("validate-yaml", true, heredoc.Doc(`
71-
Enable linting of 'Chart.yaml' and values files`))
71+
Enable linting of 'Chart.yaml' and values files`))
7272
flags.StringSlice("additional-commands", []string{}, heredoc.Doc(`
73-
Additional commands to run per chart (default: [])
74-
Commands will be executed in the same order as provided in the list and will
75-
be rendered with go template before being executed.
76-
Example: "helm unittest --helm3 -f tests/*.yaml {{ .Path }}"`))
73+
Additional commands to run per chart (default: [])
74+
Commands will be executed in the same order as provided in the list and will
75+
be rendered with go template before being executed.
76+
Example: "helm unittest --helm3 -f tests/*.yaml {{ .Path }}"`))
7777
}
7878

7979
func lint(cmd *cobra.Command, _ []string) error {

ct/cmd/root.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,9 @@ func addCommonLintAndInstallFlags(flags *pflag.FlagSet) {
9595
Additional chart repositories for dependency resolutions.
9696
Repositories should be formatted as 'name=url' (ex: local=http://127.0.0.1:8879/charts).
9797
May be specified multiple times or separate values with commas`))
98+
flags.String("helm-extra-args", "", heredoc.Doc(`
99+
Additional arguments for Helm. Must be passed as a single quoted string
100+
(e.g. "--timeout 500s")`))
98101
flags.StringSlice("helm-repo-extra-args", []string{}, heredoc.Doc(`
99102
Additional arguments for the 'helm repo add' command to be
100103
specified on a per-repo basis with an equals sign as delimiter

doc/ct_install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ ct install [flags]
5252
for command output
5353
--helm-dependency-extra-args strings Additional arguments for 'helm dependency build' (e.g. ["--skip-refresh"]
5454
--helm-extra-args string Additional arguments for Helm. Must be passed as a single quoted string
55-
(e.g. "--timeout 500s"
55+
(e.g. "--timeout 500s")
5656
--helm-extra-set-args string Additional arguments for Helm. Must be passed as a single quoted string
5757
(e.g. "--set=name=value"
5858
--helm-repo-extra-args strings Additional arguments for the 'helm repo add' command to be

doc/ct_lint-and-install.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ ct lint-and-install [flags]
4444
for command output
4545
--helm-dependency-extra-args strings Additional arguments for 'helm dependency build' (e.g. ["--skip-refresh"]
4646
--helm-extra-args string Additional arguments for Helm. Must be passed as a single quoted string
47-
(e.g. "--timeout 500s"
47+
(e.g. "--timeout 500s")
4848
--helm-extra-set-args string Additional arguments for Helm. Must be passed as a single quoted string
4949
(e.g. "--set=name=value"
5050
--helm-repo-extra-args strings Additional arguments for the 'helm repo add' command to be

doc/ct_lint.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,8 @@ ct lint [flags]
5353
--github-groups Change the delimiters for github to create collapsible groups
5454
for command output
5555
--helm-dependency-extra-args strings Additional arguments for 'helm dependency build' (e.g. ["--skip-refresh"]
56+
--helm-extra-args string Additional arguments for Helm. Must be passed as a single quoted string
57+
(e.g. "--timeout 500s")
5658
--helm-repo-extra-args strings Additional arguments for the 'helm repo add' command to be
5759
specified on a per-repo basis with an equals sign as delimiter
5860
(e.g. 'myrepo=--username test --password secret'). May be specified

pkg/tool/helm.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ func (h Helm) LintWithValues(chart string, valuesFile string) error {
5252
values = []string{"--values", valuesFile}
5353
}
5454

55-
return h.exec.RunProcess("helm", "lint", chart, values)
55+
return h.exec.RunProcess("helm", "lint", chart, values, h.extraArgs)
5656
}
5757

5858
func (h Helm) InstallWithValues(chart string, valuesFile string, namespace string, release string) error {

0 commit comments

Comments
 (0)