mirror of
https://github.com/helm/helm.git
synced 2026-08-06 16:11:25 +00:00
feat(helm): add linting support for '.tar.gz' tarballs for helm charts (#6829)
When 'helm3 lint <chart-name>.tar.gz' is run, this will lint Chart.yaml in the package Closes #6535 Signed-off-by: Kamalashree N <nagaraj.kamalashree@gmail.com>
This commit is contained in:
committed by
Martin Hickey
parent
2033853d8c
commit
73db724c6c
BIN
cmd/helm/testdata/testcharts/compressedchart-0.1.0.tar.gz
vendored
Normal file
BIN
cmd/helm/testdata/testcharts/compressedchart-0.1.0.tar.gz
vendored
Normal file
Binary file not shown.
@@ -77,7 +77,7 @@ func lintChart(path string, vals map[string]interface{}, namespace string, stric
|
||||
var chartPath string
|
||||
linter := support.Linter{}
|
||||
|
||||
if strings.HasSuffix(path, ".tgz") {
|
||||
if strings.HasSuffix(path, ".tgz") || strings.HasSuffix(path, ".tar.gz") {
|
||||
tempDir, err := ioutil.TempDir("", "helm-lint")
|
||||
if err != nil {
|
||||
return linter, errors.Wrap(err, "unable to create temp dir to extract tarball")
|
||||
|
||||
@@ -48,6 +48,10 @@ func TestLintChart(t *testing.T) {
|
||||
name: "archived-chart-path-with-hyphens",
|
||||
chartPath: "../../cmd/helm/testdata/testcharts/compressedchart-with-hyphens-0.1.0.tgz",
|
||||
},
|
||||
{
|
||||
name: "archived-tar-gz-chart-path",
|
||||
chartPath: "../../cmd/helm/testdata/testcharts/compressedchart-0.1.0.tar.gz",
|
||||
},
|
||||
{
|
||||
name: "invalid-archived-chart-path",
|
||||
chartPath: "../../cmd/helm/testdata/testcharts/invalidcompressedchart0.1.0.tgz",
|
||||
|
||||
Reference in New Issue
Block a user