pull/9758/merge
Andreas Karis 8 months ago committed by GitHub
commit f799d39882
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -20,6 +20,7 @@ import (
"fmt"
"os"
"path/filepath"
"regexp"
"testing"
"helm.sh/helm/v4/internal/test/ensure"
@ -58,6 +59,20 @@ func TestCreateCmd(t *testing.T) {
if c.Metadata.APIVersion != chart.APIVersionV2 {
t.Errorf("Wrong API version: %q", c.Metadata.APIVersion)
}
// Test that the name in Chart.yaml is quoted
chartPath := cname + "/Chart.yaml"
fileContent, err := ioutil.ReadFile(chartPath)
if err != nil {
t.Errorf("Got error when reading Chart.yaml at path %q: %q", chartPath, err)
}
m, err := regexp.Match("\nname: \""+cname+"\"\n", fileContent)
if err != nil {
t.Errorf("Could not apply regex for file %q", chartPath)
}
if !m {
t.Errorf("Could not find quoted name in %q", chartPath)
}
}
func TestCreateStarterCmd(t *testing.T) {

@ -77,7 +77,7 @@ const maxChartNameLength = 250
const sep = string(filepath.Separator)
const defaultChartfile = `apiVersion: v2
name: %s
name: "%s"
description: A Helm chart for Kubernetes
# A chart can be either an 'application' or a 'library' chart.

Loading…
Cancel
Save