carvel-dev / vendir

Easy way to vendor portions of git repos, github releases, helm charts, docker image contents, etc. declaratively
https://carvel.dev/vendir
Apache License 2.0
279 stars 50 forks source link

Added support for `http` fetch within `githubRelease` #152

Closed niallthomson closed 2 years ago

niallthomson commented 2 years ago

This change allows the optional use of an http section within a githubRelease block, which can be used to directly create the URL of the asset to download with metadata from the GitHub release such as the tag name. The url parameter of http can interpolate the tag of the GitHub release using the {tag} token.

This is useful for several use-cases, primarily when a project publishes GitHub releases but does not include files as assets directly. It will also provide a solution for #145.

Example usage:

apiVersion: vendir.k14s.io/v1alpha1
kind: Config
directories:
- path: vendor
  contents:
  # templates http url with release tag
  - path: github.com/kubernetes/kubectl
    githubRelease:
      slug: kubernetes/kubernetes
      tagSelection:
        semver:
          constraints: "~v1.23.x"
      http:
        url: https://dl.k8s.io/release/{tag}/bin/linux/amd64/kubectl
vmwclabot commented 2 years ago

@niallthomson, you must sign our contributor license agreement before your changes are merged. Click here to sign the agreement. If you are a VMware employee, read this for further instruction.

niallthomson commented 2 years ago

Looks like the tests are failing due to API request limits or am I missing something?

cppforlife commented 2 years ago

@niallthomson would you mind rebasing on develop. i pushed a fix for symlink failures we've seen (seems like github action error detecting logic somehow changed and starting seeing it as error).

it does seem like there is a rate limit problem if it doesnt "disappear" we can configure to use GITHUB_TOKEN.

niallthomson commented 2 years ago

@cppforlife rebased and pushed

cppforlife commented 2 years ago

test failure is unrelated. im going to merge and resolve the test failure separately by setting github token in the CI. thanks for contributing @niallthomson.

vmwclabot commented 2 years ago

@niallthomson, VMware has approved your signed contributor license agreement.