Fixing issue where archives created on windows have broken paths

When archives are created on windows the path spearator in the
archive file is \\. This causes issues when the file is unpacked.
For example, on Linux the files are unpacked in a flat structure
and \ is part of the file name. This causes comp issues. In Helm
v2 the path was set as / when the archive was written. This works
on both Windows and POSIX systems.

The fix being implemented is to use the ToSlash function to ensure
/ is used as the separator.

Fixes #7748

Signed-off-by: Matt Farina <matt@mattfarina.com>
pull/7751/head
Matt Farina 5 years ago
parent ec1d1a3d3e
commit 28b085bed5
No known key found for this signature in database
GPG Key ID: 9436E80BFBA46909

@ -223,7 +223,7 @@ func writeTarContents(out *tar.Writer, c *chart.Chart, prefix string) error {
func writeToTar(out *tar.Writer, name string, body []byte) error {
// TODO: Do we need to create dummy parent directory names if none exist?
h := &tar.Header{
Name: name,
Name: filepath.ToSlash(name),
Mode: 0644,
Size: int64(len(body)),
ModTime: time.Now(),

Loading…
Cancel
Save