-
Notifications
You must be signed in to change notification settings - Fork 72
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: export_published_chart correctly detects and exports tar file #2052
Conversation
Refs: lfn-cnti#1947 - Fixes the issue where multiple tar files caused the Tar module to fail due to globbing, by selecting a single tgz file. - There was a line that was supposed to delete the tgz file (no idea why): FileUtils.rm_rf(tgz_name), which did not actually work due to the previously mentioned globbing, it was removed because it would now cause the program to fail. Signed-off-by: svteb <slavo.valko@tietoevry.com>
Refs: lfn-cnti#1947 - Backtracked on removal of: FileUtils.rm_rf(tgz_name), made it functional through Dir.glob("#{Helm.chart_name(helm_chart)}-*.tgz"). Through this addition a state where multiple tgz archives are present is not possible. - Also added an exception in case a prior helm failure happens and no archive is pulled (not sure whether this state can be reached). Signed-off-by: svteb <slavo.valko@tietoevry.com>
Comments from @martin-mat were correct in pointing out some unhandled cases/lack of information provided. I've come to understand the intentions behind
It was necessary to do it like this because Another mistake from the previous commit, that was undiscovered, was the necessity of moving this entire block before the block where tgz archive is being discovered, as the
Furthermore I added an exception that prints better information in case no tgz file is discovered. |
- Dir.glob functionality for getting tgz files in the working directory abstracted into a function - get_tgz_name function made more generic - outputs made more explicit Signed-off-by: svteb <slavo.valko@tietoevry.com>
2bfb97c
to
255da4d
Compare
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, good refactoring!
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.
Other than mentioned problem - looks nice: fixes the Tar problem and refactors the code
cdcf9b1
to
4746e73
Compare
Signed-off-by: svteb <slavo.valko@tietoevry.com>
4746e73
to
c764af9
Compare
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
Description
Removed file globbing as it caused errors and added a new function that will detect a specific tgz file to be untared. Removed the line:
FileUtils.rm_rf(tgz_name)
as it did not work previously and now that globbing has been fixed it would cause undesired behavior (honestly I was not able to figure out why it is there at all).Issues:
Refs: #1947
How has this been tested:
Types of changes:
Checklist:
Documentation
Code Review
Issue