Skip to content
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

Provide me with a machine parsable version in the vendir.lock.yml when githubRelease is used #113

Open
voor opened this issue Sep 27, 2021 · 1 comment
Labels
carvel-accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request

Comments

@voor
Copy link

voor commented Sep 27, 2021

Describe the problem/challenge you have
I really love the tagSelection capability in vendir for githubRelease, it's the best and support for conditionals is really stellar. I've started using it instead of tag after playing around with it for imgpkgBundle. For imgpkgBundle I'll get what the semver resolved to in the lock file:

apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
  - image:
      tag: v1.4.0
      url: projects.registry.vmware.com/tkg/tanzu_core/provider/provider-templates@sha256:6f48690e6e7ff5c81443134581cb4c80320767b345b347ef83038c74cc0ec549
    path: .
  path: bundle/config/upstream
- contents:
  - directory: {}
    path: .
  path: bundle/config/overlay
kind: LockConfig

But then with githubRelease I don't get anything that is easily machine parsable for follow-on scripts:

apiVersion: vendir.k14s.io/v1alpha1
directories:
- contents:
  - githubRelease:
      url: https://api.github.com/repos/kubernetes-sigs/cluster-api-provider-aws/releases/47009918
    path: .
  path: bundle/config/upstream
- contents:
  - directory: {}
    path: .
  path: bundle/config/overlay
kind: LockConfig

Describe the solution you'd like
I'm telling vendir what to check against, like this example:

apiVersion: vendir.k14s.io/v1alpha1
kind: Config
minimumRequiredVersion: 0.12.0
directories:
  - path: bundle/config/upstream
    contents:
      - path: .
        githubRelease:
          slug: kubernetes-sigs/cluster-api-provider-aws
          tagSelection:
            semver:
              constraints: ">0.6.5 <0.7.0"
          assetNames: ["infrastructure-components.yaml"]
          disableAutoChecksumValidation: true
  - path: bundle/config/overlay
    contents:
    - path: .
      directory:
        path: manifests

I want to know what release I ended up with in such a way I can just run through:

yq eval '.. | select(has("tag")).tag' vendir.lock.yml vendir.yml

to get the tag that was resolved.

I am doing this already with imgpkgBundle and githubRelease when I explicitly set the tag, but this capability stops working if I move to tagSelection. I can do something similar with helmChart (just change to version instead of tag)

Anything else you would like to add:
I am happy to change up my process if there's a more robust solution here, maybe some kind of aggregate "version collector" or similar for vendir that can help establish a "lock versioning" based on what was fetched.


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.

@voor voor added carvel-triage This issue has not yet been reviewed for validity enhancement This issue is a feature request labels Sep 27, 2021
@cppforlife
Copy link
Contributor

@voor that seems like an oversight when githubRelease was taught to be tagSelection friendly. seems like a reasonable thing to add.

@cppforlife cppforlife added carvel-accepted This issue should be considered for future work and that the triage process has been completed and removed carvel-triage This issue has not yet been reviewed for validity labels Oct 1, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
carvel-accepted This issue should be considered for future work and that the triage process has been completed enhancement This issue is a feature request
Projects
Status: Unprioritized
Development

No branches or pull requests

2 participants