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>
pull/6835/head
Kamalashree Nagaraj 6 years ago committed by Martin Hickey
parent 2033853d8c
commit 73db724c6c

@ -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",

Loading…
Cancel
Save