Skip to content

Commit

Permalink
chore: rename chart and test case with clear intention
Browse files Browse the repository at this point in the history
  • Loading branch information
ardikabs committed Nov 1, 2023
1 parent b7b85b1 commit 790dbf0
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -771,8 +771,8 @@ releaseName: podinfo2
assert.Contains(t, string(podinfo2ChartContents), "version: 6.1.8")
}

// Addressed: https://github.com/kubernetes-sigs/kustomize/issues/5163
func TestHelmChartInflationGeneratorWithLocalChartWithVersion5163(t *testing.T) {
// Reference: https://github.com/kubernetes-sigs/kustomize/issues/5163
func TestHelmChartInflationGeneratorUsingVersionWithoutRepo(t *testing.T) {
th := kusttest_test.MakeEnhancedHarnessWithTmpRoot(t).
PrepBuiltin("HelmChartInflationGenerator")
defer th.Reset()
Expand All @@ -786,21 +786,22 @@ func TestHelmChartInflationGeneratorWithLocalChartWithVersion5163(t *testing.T)
apiVersion: builtin
kind: HelmChartInflationGenerator
metadata:
name: issue5163
name: issue5163
name: foo-chart
name: foo-chart
version: 1.0.0
releaseName: issue5163
releaseName: foo-chart
chartHome: ./charts
`)

cm, err := rm.Resources()[0].GetFieldValue("metadata.name")
assert.NoError(t, err)
assert.Equal(t, "bar", cm)

chartDir := filepath.Join(th.GetRoot(), "charts/issue5163")
chartDir := filepath.Join(th.GetRoot(), "charts/foo-chart")
assert.True(t, th.GetFSys().Exists(chartDir))

chartYamlContent, err := th.GetFSys().ReadFile(filepath.Join(chartDir, "Chart.yaml"))
assert.NoError(t, err)
assert.Contains(t, string(chartYamlContent), "name: foo-chart")
assert.Contains(t, string(chartYamlContent), "version: 1.0.0")
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
apiVersion: v2
name: issue5163
name: foo-chart
description: A Helm chart for Kubernetes

# A chart can be either an 'application' or a 'library' chart.
Expand Down

0 comments on commit 790dbf0

Please sign in to comment.