mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
helm: add kube-version and api-versions on CLI args
It makes sense to add that as a CLI args since you could use one single kustomization file/helm chart for multiple clusters. Also it's easier to have those on the CLI if the user has some kind of tooling that will end up calling kustomize and that could pass those (i.e.: ArgoCD is doing that for Helm so it could do that for Kustomize as well that will end up calling Helm as well). Signed-off-by: Arthur Outhenin-Chalandre <arthur.outhenin-chalandre@ledger.fr>
This commit is contained in:
@@ -53,6 +53,15 @@ func (p *HelmChartInflationGeneratorPlugin) Config(
|
||||
if h.GeneralConfig().HelmConfig.Command == "" {
|
||||
return fmt.Errorf("must specify --helm-command")
|
||||
}
|
||||
|
||||
// CLI args takes precedence
|
||||
if h.GeneralConfig().HelmConfig.KubeVersion != "" {
|
||||
p.HelmChart.KubeVersion = h.GeneralConfig().HelmConfig.KubeVersion
|
||||
}
|
||||
if len(h.GeneralConfig().HelmConfig.ApiVersions) != 0 {
|
||||
p.HelmChart.ApiVersions = h.GeneralConfig().HelmConfig.ApiVersions
|
||||
}
|
||||
|
||||
p.h = h
|
||||
if err = yaml.Unmarshal(config, p); err != nil {
|
||||
return
|
||||
|
||||
@@ -4,8 +4,10 @@
|
||||
package types
|
||||
|
||||
type HelmConfig struct {
|
||||
Enabled bool
|
||||
Command string
|
||||
Enabled bool
|
||||
Command string
|
||||
ApiVersions []string
|
||||
KubeVersion string
|
||||
}
|
||||
|
||||
// PluginConfig holds plugin configuration.
|
||||
|
||||
Reference in New Issue
Block a user