mirror of
https://github.com/helm/chart-testing.git
synced 2026-02-05 09:45:14 +01:00
add --extra-helm-args to ct lint (#552)
Signed-off-by: AndersBennedsgaard <abbennedsgaard@gmail.com>
This commit is contained in:
committed by
GitHub
parent
585f1b3be3
commit
0d4ab8035a
@@ -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`))
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user