-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add option to unpack archive downloaded when using "http". #150
Comments
Note, it would be required that when unpacking the archive that the option exists to preserve execute bits. Of note, when unpacking an archive from a |
Thanks @GrahamDumpleton ! it sounds like preserving the execute mode bits could present some stumbling blocks but we'll leave that to the initial implementation exploration. |
@GrahamDumpleton Am I missing something with http? I think this is already supported?
from: https://carvel.dev/vendir/docs/v0.32.0/vendir-spec/ Specifically:
|
It works with zip files. I think the problem is it doesn't work with .tar.gz files? |
I suspect unpacking for |
Understandable, just wanted to make you aware if you still needed it. I'll look and see if I can figure out why it doesn't support |
If it helps anyone, this is where the logic is: vendir/pkg/vendir/fetch/archive.go Lines 147 to 160 in bc7a968
And I get this error for my 'tar.gz' file:
That is I guess the problem is that the custom logic looking into the Looking at some golang internal code: https://pkg.go.dev/golang.org/x/build/internal/untar |
While looking into it I realized that the fix is so trivial that I opened a PR. |
Thank you so much for looking into this @reegnz and creating a PR. Do you always get the same error while unpacking tar.gz files or this happens only in certain cases? Also, do you mind creating a new issue with the details, as @knechtionscoding rightly pointed out, the feature to unpack archive files has been there for a long time and it works by default, so we can close this issue. |
If this issue is going to be closed, then a new issue also needs to be created for the fact that execute permissions are not preserved when archives are unpacked. This was also mentioned above in this issue. This preservation of execute permissions is also lacking with archives unpacked from GitHub releases. To round things out, there should also be a way to set execute permissions when provided files using |
Thank you for pointing this out @GrahamDumpleton 🙇🏻 it had almost skipped my mind 😅 |
@praveenrewar opened a separate issue for the fix and linked the PR to that one. I'm strictly focused on the extraction issue, the permissions issue I'll let someone else pick up instead. |
Thank you so much @reegnz! |
Describe the problem/challenge you have
When downloading archive file using
http
I need the archive file to be automatically unpacked.Describe the solution you'd like
The
githubRelease
option hasunpackArchive
for something similar although in that case you need to designate the file to unpack. In the case ofhttp
, there is only the one asset file so could get away with a single boolean flag to indicate whether download should be unpacked.Anything else you would like to add:
I am assuming that once unpacked you can still use
newRootPath
so as to indicate you want the final result to only include files which existed in a subdirectory of the archive.For example, in the archive above the top level directory it unpacks into is
wrapt-develop
. I am hoping one can do:so that top level
wrapt-develop
directory in the archive is eliminated and you get just the files in it.Vote on this request
This is an invitation to the community to vote on issues, to help us prioritize our backlog. Use the "smiley face" up to the right of this comment to vote.
👍 "I would like to see this addressed as soon as possible"
👎 "There are other more important things to focus on right now"
We are also happy to receive and review Pull Requests if you want to help working on this issue.
The text was updated successfully, but these errors were encountered: