mirror of
https://github.com/helm/helm.git
synced 2026-04-23 07:07:30 -04:00
Merge pull request #30898 from fidelity-contributions/fix-issue-13198
Fix issue 13198
This commit is contained in:
commit
bbea98ed6b
4 changed files with 11 additions and 2 deletions
|
|
@ -201,7 +201,7 @@ func newTemplateCmd(cfg *action.Configuration, out io.Writer) *cobra.Command {
|
|||
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.StringVar(&kubeVersion, "kube-version", "", "Kubernetes version used for Capabilities.KubeVersion")
|
||||
f.StringSliceVarP(&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 (multiple can be specified)")
|
||||
f.BoolVar(&client.UseReleaseName, "release-name", false, "use release name in the output-dir path.")
|
||||
bindPostRenderFlag(cmd, &client.PostRenderer)
|
||||
|
||||
|
|
|
|||
|
|
@ -83,7 +83,12 @@ func TestTemplateCmd(t *testing.T) {
|
|||
},
|
||||
{
|
||||
name: "check kube api versions",
|
||||
cmd: fmt.Sprintf("template --api-versions helm.k8s.io/test '%s'", chartPath),
|
||||
cmd: fmt.Sprintf("template --api-versions helm.k8s.io/test,helm.k8s.io/test2 '%s'", chartPath),
|
||||
golden: "output/template-with-api-version.txt",
|
||||
},
|
||||
{
|
||||
name: "check kube api versions",
|
||||
cmd: fmt.Sprintf("template --api-versions helm.k8s.io/test --api-versions helm.k8s.io/test2 '%s'", chartPath),
|
||||
golden: "output/template-with-api-version.txt",
|
||||
},
|
||||
{
|
||||
|
|
|
|||
|
|
@ -75,6 +75,7 @@ metadata:
|
|||
kube-version/minor: "20"
|
||||
kube-version/version: "v1.20.0"
|
||||
kube-api-version/test: v1
|
||||
kube-api-version/test2: v2
|
||||
spec:
|
||||
type: ClusterIP
|
||||
ports:
|
||||
|
|
|
|||
|
|
@ -11,6 +11,9 @@ metadata:
|
|||
{{- if .Capabilities.APIVersions.Has "helm.k8s.io/test" }}
|
||||
kube-api-version/test: v1
|
||||
{{- end }}
|
||||
{{- if .Capabilities.APIVersions.Has "helm.k8s.io/test2" }}
|
||||
kube-api-version/test2: v2
|
||||
{{- end }}
|
||||
spec:
|
||||
type: {{ .Values.service.type }}
|
||||
ports:
|
||||
|
|
|
|||
Loading…
Reference in a new issue