diff --git a/cmd/chart-repo/utils.go b/cmd/chart-repo/utils.go index a23a5a624..7cbbdf141 100644 --- a/cmd/chart-repo/utils.go +++ b/cmd/chart-repo/utils.go @@ -468,7 +468,7 @@ func extractFilesFromTarball(filenames []string, tarf *tar.Reader) (map[string]s } for _, f := range filenames { - if header.Name == f { + if strings.EqualFold(header.Name, f) { var b bytes.Buffer io.Copy(&b, tarf) ret[f] = string(b.Bytes()) diff --git a/cmd/chart-repo/utils_test.go b/cmd/chart-repo/utils_test.go index b0493f58f..b9cd4af10 100644 --- a/cmd/chart-repo/utils_test.go +++ b/cmd/chart-repo/utils_test.go @@ -479,6 +479,7 @@ func Test_extractFilesFromTarball(t *testing.T) { {"file", []tarballFile{{"file.txt", "best file ever"}}, "file.txt", "best file ever"}, {"multiple file tarball", []tarballFile{{"file.txt", "best file ever"}, {"file2.txt", "worst file ever"}}, "file2.txt", "worst file ever"}, {"file in dir", []tarballFile{{"file.txt", "best file ever"}, {"test/file2.txt", "worst file ever"}}, "test/file2.txt", "worst file ever"}, + {"filename ignore case", []tarballFile{{"Readme.md", "# readme for chart"}, {"values.yaml", "key: value"}}, "README.md", "# readme for chart"}, } for _, tt := range tests {