mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-06-14 02:20:53 +00:00
helm: add kube-version
Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@ledger.fr>
This commit is contained in:
@@ -88,6 +88,9 @@ type HelmChart struct {
|
|||||||
// ApiVersions is the kubernetes apiversions used for Capabilities.APIVersions
|
// ApiVersions is the kubernetes apiversions used for Capabilities.APIVersions
|
||||||
ApiVersions []string `json:"apiVersions,omitempty" yaml:"apiVersions,omitempty"`
|
ApiVersions []string `json:"apiVersions,omitempty" yaml:"apiVersions,omitempty"`
|
||||||
|
|
||||||
|
// KubeVersion is the kubernetes version used by Helm for Capabilities.KubeVersion"
|
||||||
|
KubeVersion string `json:"kubeVersion,omitempty" yaml:"kubeVersion,omitempty"`
|
||||||
|
|
||||||
// NameTemplate is for specifying the name template used to name the release.
|
// NameTemplate is for specifying the name template used to name the release.
|
||||||
NameTemplate string `json:"nameTemplate,omitempty" yaml:"nameTemplate,omitempty"`
|
NameTemplate string `json:"nameTemplate,omitempty" yaml:"nameTemplate,omitempty"`
|
||||||
|
|
||||||
@@ -172,6 +175,10 @@ func (h HelmChart) AsHelmArgs(absChartHome string) []string {
|
|||||||
for _, apiVer := range h.ApiVersions {
|
for _, apiVer := range h.ApiVersions {
|
||||||
args = append(args, "--api-versions", apiVer)
|
args = append(args, "--api-versions", apiVer)
|
||||||
}
|
}
|
||||||
|
if h.KubeVersion != "" {
|
||||||
|
args = append(args, "--kube-version", h.KubeVersion)
|
||||||
|
}
|
||||||
|
|
||||||
if h.IncludeCRDs {
|
if h.IncludeCRDs {
|
||||||
args = append(args, "--include-crds")
|
args = append(args, "--include-crds")
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ func TestAsHelmArgs(t *testing.T) {
|
|||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
Repo: "https://helm.releases.hashicorp.com",
|
Repo: "https://helm.releases.hashicorp.com",
|
||||||
ApiVersions: []string{"foo", "bar"},
|
ApiVersions: []string{"foo", "bar"},
|
||||||
|
KubeVersion: "1.27",
|
||||||
NameTemplate: "template",
|
NameTemplate: "template",
|
||||||
SkipTests: true,
|
SkipTests: true,
|
||||||
IncludeCRDs: true,
|
IncludeCRDs: true,
|
||||||
@@ -33,6 +34,7 @@ func TestAsHelmArgs(t *testing.T) {
|
|||||||
"-f", "values",
|
"-f", "values",
|
||||||
"-f", "values1", "-f", "values2",
|
"-f", "values1", "-f", "values2",
|
||||||
"--api-versions", "foo", "--api-versions", "bar",
|
"--api-versions", "foo", "--api-versions", "bar",
|
||||||
|
"--kube-version", "1.27",
|
||||||
"--include-crds",
|
"--include-crds",
|
||||||
"--skip-tests",
|
"--skip-tests",
|
||||||
"--no-hooks"})
|
"--no-hooks"})
|
||||||
|
|||||||
Reference in New Issue
Block a user