mirror of
https://github.com/kubernetes-sigs/kustomize.git
synced 2026-05-17 18:25:26 +00:00
Merge pull request #5865 from milkshake308/feat_helm_devel_arg
feat(helm): allow the use of devel alias for helmcharts
This commit is contained in:
@@ -343,6 +343,9 @@ func (p *plugin) pullCommand() []string {
|
||||
if p.Version != "" {
|
||||
args = append(args, "--version", p.Version)
|
||||
}
|
||||
if p.Devel {
|
||||
args = append(args, "--devel")
|
||||
}
|
||||
return args
|
||||
}
|
||||
|
||||
|
||||
@@ -993,3 +993,37 @@ debug: true
|
||||
assert.Contains(t, string(chartYamlContent), "name: test-chart")
|
||||
assert.Contains(t, string(chartYamlContent), "version: 1.0.0")
|
||||
}
|
||||
|
||||
func TestHelmChartInflationGeneratorWithDevel(t *testing.T) {
|
||||
th := kusttest_test.MakeEnhancedHarnessWithTmpRoot(t).
|
||||
PrepBuiltin("HelmChartInflationGenerator")
|
||||
defer th.Reset()
|
||||
if err := th.ErrIfNoHelm(); err != nil {
|
||||
t.Skip("skipping: " + err.Error())
|
||||
}
|
||||
copyTestChartsIntoHarness(t, th)
|
||||
|
||||
rm := th.LoadAndRunGenerator(`
|
||||
apiVersion: builtin
|
||||
kind: HelmChartInflationGenerator
|
||||
metadata:
|
||||
name: sm-operator
|
||||
name: sm-operator
|
||||
version: 0.1.0-Beta
|
||||
repo: https://charts.bitwarden.com/
|
||||
releaseName: sm-operator
|
||||
chartHome: ./charts
|
||||
devel: true
|
||||
`)
|
||||
cm, err := rm.Resources()[0].GetFieldValue("metadata.name")
|
||||
require.NoError(t, err)
|
||||
assert.Equal(t, "sm-operator-controller-manager", cm)
|
||||
|
||||
chartDir := filepath.Join(th.GetRoot(), "charts/sm-operator-0.1.0-Beta/sm-operator")
|
||||
assert.True(t, th.GetFSys().Exists(chartDir))
|
||||
|
||||
chartYamlContent, err := th.GetFSys().ReadFile(filepath.Join(chartDir, "Chart.yaml"))
|
||||
require.NoError(t, err)
|
||||
assert.Contains(t, string(chartYamlContent), "name: sm-operator")
|
||||
assert.Contains(t, string(chartYamlContent), "version: 0.1.0-Beta")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user