Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix filenames in tarball created on windows #3984

Merged
merged 2 commits into from
May 28, 2018
Merged

Conversation

muehlburger
Copy link

@muehlburger muehlburger commented Apr 27, 2018

This fixes #3764.

@k8s-ci-robot k8s-ci-robot added size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Apr 27, 2018
@muehlburger muehlburger changed the title Fix filenames in tarball created on windows #3763 Fix filenames in tarball created on windows Apr 27, 2018
@@ -204,6 +205,7 @@ func writeTarContents(out *tar.Writer, c *chart.Chart, prefix string) error {
// writeToTar writes a single file to a tar archive.
func writeToTar(out *tar.Writer, name string, body []byte) error {
// TODO: Do we need to create dummy parent directory names if none exist?
name = strings.Replace(name, "\\", "/", -1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to use filepath.ToSlash/filepath.FromSlash here.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right. Thank's for the hint. Updated the PR.

@muehlburger
Copy link
Author

I refactored the code.

@bacongobbler bacongobbler merged commit 3771ef8 into helm:master May 28, 2018
@muehlburger muehlburger deleted the dev branch June 4, 2018 12:50
@danielcb danielcb mentioned this pull request Jun 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Windows back slash carry to file name after unzip
4 participants