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

pkg/bindings/images.nTar(): slashify hdr.Name values #11260

Merged
merged 1 commit into from
Aug 19, 2021

Conversation

nalind
Copy link
Member

@nalind nalind commented Aug 18, 2021

When setting path names in the build context archive, convert path names to use forward slashes, as is normal for those archives, so that directory hierarchies archived on Windows hosts extract correctly everywhere.

Fixes #11259

@nalind nalind force-pushed the remote-build-path branch from 1386f73 to 86779b9 Compare August 18, 2021 13:57
@nalind nalind changed the title b/pkg/bindings/images.nTar(): slashify hdr.Name values pkg/bindings/images.nTar(): slashify hdr.Name values Aug 18, 2021
@nalind nalind force-pushed the remote-build-path branch from 86779b9 to 686bd64 Compare August 18, 2021 14:01
When setting path names in the build context archive, convert path names
to use forward slashes, as is normal for those archives, so that
directory hierarchies archived on Windows hosts extract correctly
everywhere.

Not really sure how to run the remote client in CI on a system that uses
`\` as a path separator, which is where this error crops up, so
[NO TESTS NEEDED]

Signed-off-by: Nalin Dahyabhai <[email protected]>
@nalind nalind force-pushed the remote-build-path branch from 686bd64 to aeffdb0 Compare August 18, 2021 15:04
@TomSweeneyRedHat
Copy link
Member

Neat change @nalind
LGTM

@@ -481,9 +481,9 @@ func nTar(excludes []string, sources ...string) (io.ReadCloser, error) {
return nil // skip root dir
}

name := strings.TrimPrefix(path, s+string(filepath.Separator))
name := filepath.ToSlash(strings.TrimPrefix(path, s+string(filepath.Separator)))
Copy link
Member

Choose a reason for hiding this comment

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

What exactly is changing here? I am not seeing it?

Copy link
Member

Choose a reason for hiding this comment

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

AIUI filepath.ToSlash(), when run on Windows, will have separator set to backslash and will convert those to normal slashes.

@rhatdan
Copy link
Member

rhatdan commented Aug 19, 2021

@vrothberg @giuseppe PTAL

@rhatdan
Copy link
Member

rhatdan commented Aug 19, 2021

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Aug 19, 2021
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Aug 19, 2021

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: nalind, rhatdan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 19, 2021
@rhatdan
Copy link
Member

rhatdan commented Aug 19, 2021

/hold

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 19, 2021
@rhatdan rhatdan removed the lgtm Indicates that a PR is ready to be merged. label Aug 19, 2021
@openshift-merge-robot openshift-merge-robot merged commit 8b84874 into containers:main Aug 19, 2021
@rhatdan rhatdan removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Aug 19, 2021
@rhatdan
Copy link
Member

rhatdan commented Aug 19, 2021

I accidentally approved this one. I fail to see any change in this code, other then rearranging it a bit. Maybe I am missing it.

@rhatdan
Copy link
Member

rhatdan commented Aug 19, 2021

Oops, it merged, I guess I was too slow. Not that it matters, but I am still unsure this fixes the issue.

@nalind nalind deleted the remote-build-path branch August 19, 2021 13:04
@github-actions github-actions bot added the locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments. label Sep 22, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 22, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. locked - please file new issue/PR Assist humans wanting to comment on an old issue or PR with locked comments.
Projects
None yet
5 participants