Skip to content

Commit d5dd5f4

Browse files
committed
helm: add kube-version
Signed-off-by: Arthur Outhenin-Chalandre <[email protected]>
1 parent 5b51722 commit d5dd5f4

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

api/types/helmchartargs.go

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ type HelmChart struct {
8888
// ApiVersions is the kubernetes apiversions used for Capabilities.APIVersions
8989
ApiVersions []string `json:"apiVersions,omitempty" yaml:"apiVersions,omitempty"`
9090

91+
// KubeVersion is the kubernetes version used by Helm for Capabilities.KubeVersion"
92+
KubeVersion string `json:"kubeVersion,omitempty" yaml:"kubeVersion,omitempty"`
93+
9194
// NameTemplate is for specifying the name template used to name the release.
9295
NameTemplate string `json:"nameTemplate,omitempty" yaml:"nameTemplate,omitempty"`
9396

@@ -172,6 +175,10 @@ func (h HelmChart) AsHelmArgs(absChartHome string) []string {
172175
for _, apiVer := range h.ApiVersions {
173176
args = append(args, "--api-versions", apiVer)
174177
}
178+
if h.KubeVersion != "" {
179+
args = append(args, "--kube-version", h.KubeVersion)
180+
}
181+
175182
if h.IncludeCRDs {
176183
args = append(args, "--include-crds")
177184
}

api/types/helmchartargs_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ func TestAsHelmArgs(t *testing.T) {
1717
Version: "1.0.0",
1818
Repo: "https://helm.releases.hashicorp.com",
1919
ApiVersions: []string{"foo", "bar"},
20+
KubeVersion: "1.27",
2021
NameTemplate: "template",
2122
SkipTests: true,
2223
IncludeCRDs: true,
@@ -33,6 +34,7 @@ func TestAsHelmArgs(t *testing.T) {
3334
"-f", "values",
3435
"-f", "values1", "-f", "values2",
3536
"--api-versions", "foo", "--api-versions", "bar",
37+
"--kube-version", "1.27",
3638
"--include-crds",
3739
"--skip-tests",
3840
"--no-hooks"})

0 commit comments

Comments
 (0)