carvel-dev / carvel-dev/vendir

`githubRelease.unpackArchive.path` should support globbing

Open
#49 2 comments 2 reactions 0 assignees View on GitHub
carvel-accepted enhancement
Dominant language
Go
Stars
399
Forks
73
Avg merge
2h 53m
Merged PRs (30d)
2

Description

**Describe the problem/challenge you have**
Assets in Github releases often include the release version as part of the asset's filename, but `vendir`'s `unpackArchive` option does not currently support globbing, although the `githubRelease.assetNames` array does support globbing. Lack of globbing support means that `unpackArchive` cannot be used as intended for many Github Releases.

Currently, attempting to pass a glob results in a cryptic "Expected known archive type (zip, tgz, tar)" error message.

For example,

this works, but you have to know the filename in advance:

```yaml
- path: prometheus
githubRelease:
slug: prometheus/prometheus
latest: true
disableAutoChecksumValidation: true
assetNames: ["prometheus-*.linux-amd64.tar.gz"]
unpackArchive:
path: 'prometheus-2.25.0.linux-amd64.tar.gz'
```

this fails:

```yaml
- path: prometheus
githubRelease:
slug: prometheus/prometheus
latest: true
disableAutoChecksumValidation: true
assetNames: ["prometheus-*.linux-amd64.tar.gz"]
unpackArchive:
path: 'prometheus-*.linux-amd64.tar.gz'
```
“Error: Syncing directory ‘config/upstream’: Syncing directory ‘prometheus’ with github release contents: Expected known archive type (zip, tgz, tar)”

**Describe the solution you'd like**
Globbing should be supported. If the user-provided glob matches multiple files, an error message would be acceptable, as would be unpacking all of the specified archives.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.