Add support for CSVs in template --api-versions arg

This commit changes the template sub-command argument
`--api-versions` from `StringArrayVarP` to `StringSliceVarP`,
to allow support for comma separated variables. This will allow
users to use a syntax such as `--api-versions one,two,three` over
`--api-versions one --api-versions two --api-versions three`.

Fixes: #11485

Signed-off-by: Ryan Drew <ryan.drew@isovalent.com>
pull/11490/head
Ryan Drew 2 years ago
parent 7ed9d16dc7
commit 5aa316e1ee
No known key found for this signature in database
GPG Key ID: 94D9A5AA7A188200

@ -181,7 +181,7 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
f.BoolVar(&skipTests, "skip-tests", false, "skip tests from templated output") f.BoolVar(&skipTests, "skip-tests", false, "skip tests from templated output")
f.BoolVar(&client.IsUpgrade, "is-upgrade", false, "set .Release.IsUpgrade instead of .Release.IsInstall") f.BoolVar(&client.IsUpgrade, "is-upgrade", false, "set .Release.IsUpgrade instead of .Release.IsInstall")
f.StringVar(&kubeVersion, "kube-version", "", "Kubernetes version used for Capabilities.KubeVersion") f.StringVar(&kubeVersion, "kube-version", "", "Kubernetes version used for Capabilities.KubeVersion")
f.StringArrayVarP(&extraAPIs, "api-versions", "a", []string{}, "Kubernetes api versions used for Capabilities.APIVersions") f.StringSliceVarP(&extraAPIs, "api-versions", "a", []string{}, "Kubernetes api versions used for Capabilities.APIVersions")
f.BoolVar(&client.UseReleaseName, "release-name", false, "use release name in the output-dir path.") f.BoolVar(&client.UseReleaseName, "release-name", false, "use release name in the output-dir path.")
bindPostRenderFlag(cmd, &client.PostRenderer) bindPostRenderFlag(cmd, &client.PostRenderer)

Loading…
Cancel
Save