-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Fixed crash in kubectl cp when path has multiple leading slashes #58144
Conversation
/assign @smarterclayton |
/ok-to-test |
/retest |
/lgtm |
} | ||
return file | ||
// tar strips the leading '/' if it's there, so we will too | ||
return strings.TrimLeft(file, "/") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
isn't there a "clean" func in os/path
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, and it is used after calling this function (https://github.com/tomerf/kubernetes/blob/52f02c42e6a84a551b0f7eade38be62dd6c37cf2/pkg/kubectl/cmd/cp.go#L236).
But it only make the path canonical, it doesn't remove prefix slash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sttts Is that okay?
/lgtm |
@pwittrock Approve? |
/approve |
/approve no-issue |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dixudx, pwittrock, sttts, tomerf Associated issue requirement bypassed by: pwittrock The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these OWNERS Files:
You can indicate your approval by writing |
What else is needed for merge? |
/retest |
/test all Tests are more than 96 hours old. Re-running tests. |
Automatic merge from submit-queue (batch tested with PRs 58144, 57149). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it: Fixed crash in kubectl cp when path has multiple leading slashes
For example:
Which issue(s) this PR fixes None
Special notes for your reviewer: None
Release note: