fix(helm): allow special char in chart repo name (#1366) · grafana/tanka@ea63f8d

Original file line numberDiff line numberDiff line change

@@ -50,6 +50,15 @@ func TestParseReq(t *testing.T) {

5050

input: "https://helm.releases.hashicorp.com/vault@0.19.0",

5151

err: errors.New("not of form 'repo/chart@version(:path)' where repo contains no special characters"),

5252

},

53+

{

54+

name: "repo-with-special-chars",

55+

input: "with-dashes/package@1.0.0",

56+

expected: &Requirement{

57+

Chart: "with-dashes/package",

58+

Version: "1.0.0",

59+

Directory: "",

60+

},

61+

},

5362

}

5463
5564

for _, tc := range testCases {

@@ -68,12 +77,13 @@ func TestAddRepos(t *testing.T) {

6877

err = c.AddRepos(

6978

Repo{Name: "foo", URL: "https://foo.com"},

7079

Repo{Name: "foo2", URL: "https://foo2.com"},

80+

Repo{Name: "with-dashes", URL: "https://foo.com"},

7181

)

7282

assert.NoError(t, err)

7383
74-

// Only \w characters are allowed in repo names

84+

// Only \w- characters are allowed in repo names

7585

err = c.AddRepos(

76-

Repo{Name: "with-dashes", URL: "https://foo.com"},

86+

Repo{Name: "re:po", URL: "https://foo.com"},

7787

)

7888

assert.EqualError(t, err, "1 Repo(s) were skipped. Please check above logs for details")

7989