carvel-dev / carvel-dev/vendir
Add option to unpack archive downloaded when using "http".
- Dominant language
- Go
- Stars
- 399
- Forks
- 73
- Avg merge
- 2h 53m
- Merged PRs (30d)
- 2
Description
**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 has `unpackArchive` for something similar although in that case you need to designate the file to unpack. In the case of `http`, there is only the one asset file so could get away with a single boolean flag to indicate whether download should be unpacked.
```
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- contents:
path: src/wrapt
- http:
url: https://github.com/GrahamDumpleton/wrapt/archive/refs/heads/develop.tar.gz
unpackArchive: true
path: .
```
**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:
```
apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- contents:
path: src/wrapt
- http:
url: https://github.com/GrahamDumpleton/wrapt/archive/refs/heads/develop.tar.gz
unpackArchive: true
path: .
newRootPath: wrapt-develop
```
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.
Contributor guide
Assessment
This issue has not been assessed yet.