-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 (kubernetes-client) : Change Pod upload tarball location to target upload directory #5676
Conversation
…load directory Using `/tmp` as upload directory can be problematic for scenarios where `/tmp` is read only. We can directly upload the intermediate upload tarball to the directory where we are uploading the content. In case of uploading a file to a Pod, temporary tarball would be uploaded in the parent directory of that file. In case of uploading a directory to a Pod, temporary tarball would be uploaded in the same directory that's specified for upload path. Signed-off-by: Rohan Kumar <[email protected]>
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
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.
LGTM
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.
LGTM
Just to double check, are we deleting the temporary file in all cases?
We delete the temporary tarball after extraction: Line 173 in 272cf42
If tarball upload step fails for some reason, we issue an exec to delete tarball: Lines 150 to 153 in 272cf42
|
Description
Fix #5527
Using
/tmp
as upload directory can be problematic for scenarios where/tmp
is read only. We can directly upload the intermediate upload tarball to the directory where we are uploading the content.In case of uploading a file to a Pod, temporary tarball would be uploaded in the parent directory of that file.
In case of uploading a directory to a Pod, temporary tarball would be uploaded in the same directory that's specified for upload path.
Other minor changes:
getNextTarEntry()
withgetNextEntry()
in UploadTestgetDirectoryFromFile
method to reuse logic for extracting directory from file path. For consistency we always add a trailing/
at the end of file path.Type of change
test, version modification, documentation, etc.)
Checklist