vendir icon indicating copy to clipboard operation
vendir copied to clipboard

`githubRelease.unpackArchive.path` should support globbing

Open LukeWinikates opened this issue 4 years ago • 2 comments

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:

  - 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:

  - 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.

LukeWinikates avatar Mar 02 '21 18:03 LukeWinikates

good point!

cppforlife avatar Mar 18 '21 22:03 cppforlife

Thanks for submitting this. We may not get to this soon but would accept contributions :)

aaronshurley avatar Apr 01 '21 17:04 aaronshurley