Unverified Commit c359ea66 authored by Matt Farina's avatar Matt Farina Committed by GitHub

Merge pull request #3350 from mattfarina/fix/3349

fix(capabilities): Adding GitVersion to default set
parents 53419364 d5a865b5
......@@ -203,6 +203,7 @@ func (t *templateCmd) run(cmd *cobra.Command, args []string) error {
}
caps.KubeVersion.Major = fmt.Sprint(kv.Major())
caps.KubeVersion.Minor = fmt.Sprint(kv.Minor())
caps.KubeVersion.GitVersion = fmt.Sprintf("v%d.%d.0", kv.Major(), kv.Minor())
}
vals, err := chartutil.ToRenderValuesCaps(c, config, options, caps)
if err != nil {
......
......@@ -109,7 +109,7 @@ func TestTemplateCmd(t *testing.T) {
desc: "verify --kube-version overrides the kubernetes version",
args: []string{chartPath, "--kube-version", "1.6"},
expectKey: "subchart1/templates/service.yaml",
expectValue: "kube-version/major: \"1\"\n kube-version/minor: \"6\"",
expectValue: "kube-version/major: \"1\"\n kube-version/minor: \"6\"\n kube-version/gitversion: \"v1.6.0\"",
},
}
......
......@@ -29,11 +29,12 @@ var (
// DefaultKubeVersion is the default kubernetes version
DefaultKubeVersion = &version.Info{
Major: "1",
Minor: "9",
GoVersion: runtime.Version(),
Compiler: runtime.Compiler,
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
Major: "1",
Minor: "9",
GitVersion: "v1.9.0",
GoVersion: runtime.Version(),
Compiler: runtime.Compiler,
Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH),
}
)
......
......@@ -8,6 +8,7 @@ metadata:
release-name: "{{ .Release.Name }}"
kube-version/major: "{{ .Capabilities.KubeVersion.Major }}"
kube-version/minor: "{{ .Capabilities.KubeVersion.Minor }}"
kube-version/gitversion: "v{{ .Capabilities.KubeVersion.Major }}.{{ .Capabilities.KubeVersion.Minor }}.0"
spec:
type: {{ .Values.service.type }}
ports:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment