-
Notifications
You must be signed in to change notification settings - Fork 41
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
Take my imgpkg BundleLock and do something magical with it because it's relevant for kbld #158
Comments
I would also like to see this @voor good suggestion ! |
So I thought a little more about this, and realized with the power of I just use the BundleLock as a data values input into ytt and have my App CR (or Package CR) templatized accordingly. This does not work very well when the App CR or Package CR already includes ytt directives, of which 100% of them do, so while this was a great thought exercise I'm not sure how applicable it will become. Sharing it here for others that might be able to use this, though. Alternatively, I could keep these data values in my templated App CR and find some way to insert the BundleLock at runtime, that'll probably be my next thought experiment. |
Yes: for those reading along, when
I'm curious, what about that approach "does not work very well"? I immediately see a potential collision with other data values, given that they are all merged into a single struct. If that is part of the problem, it's worth mentioning that we've kicked around the idea of providing a way to place the parsed contents of a YAML file within the |
We already have ytt directives in our App CR, so when we ran through ytt to add in the bundle lock information it would attempt to execute those other directives, and output pure yaml. This would be unblocked from carvel-dev/ytt#63 |
few paths i see, add imgpkg builder (#56), and/or provide a way for imgpkg push to produce images lock. the problem with producing image lock is that it does not help kbld (running against PackageCR) know what to replace. |
So, @voor, what do you think of the It has the "feature" of where you'd produce the bundle through Adding something like this: ---
apiVersion: kbld.k14s.io/v1alpha1
kind: Config
sources:
- image: this-thing
path: path/to/bundle/root
imgpkg:
copy:
toRepo: ${IMGPKG_BUNDLE}
rawOptions: ["--lock-output", "current-version.yml"] (where you replace which could either be added to ... and then ... $ kbld -f package-cr.yml -f bundle-kbld-config.yml -f kbld-config.yml > versioned-package-cr.yml |
Would it be fair to say the next step in this chain would be using the same builder to then create the Package Repository? Possibly used in conjunction with vendir to grab the various package CR's from all their little repositories that have the folders of current-version.yml inside them? |
Conversation out of band but relevant to this issue: We are using this heavily with |
This starts to get tricky, actually. Because we don't expect that the folks who are producing a Package would necessarily produce the whole Package Repository.... 🤔 . I sense a cousin of the "prefer composition over inheritance" advise being relevant here.... |
Apologies for my thick-headedness... but I'm not sure what that slipper slope is for kbld... could you elaborate just a tad more on the risk you're pointing at? |
Maybe it is I who is thick-headed, and maybe what I'm asking is that kbld needs a helm template builder that can take a given folder of |
How are you imagining that From where I'm sitting, it's not likely that |
Think I probably should have linked to this repo a lot earlier in this conversation to have a solid example, but if you take a look at: https://github.com/voor/gitlab-runner-helm-imgpkg/tree/main/bundle you can see the ultimate format of the bundle just before it gets pushed, the script to actually generate this looks like this: https://github.com/voor/gitlab-runner-helm-imgpkg/blob/main/build.sh#L61-L63 My ultimate goal is to make this a lot easier to adopt, and how you can effectively take everything in this build.sh and achieve it with just the Carvel tools. |
Oooooooookay, that example really helped clarify what you're going for here. 🙏🏻 That and a quick convo with Dmitriy about this... which restored in my mind the idea that So, I think I see two feature requests in here:
The delta in the example you pointed to is that most of the How well am I tracking alongside you, now? |
Yes, I think I'm tracking. By the way, here's an updated
|
Describe the problem/challenge you have
I currently push imgpkg bundles to repositories and always use
--lock-output current-version.yml
to make sure I have a file that lets me know what tag I used and where my image is located. I am an experienced Carvel user, so I know that I then need to copybundle.image
out of that resulting file and paste it into my App CR (or Package CR) for use in kapp-controller. Future users might not understand that flow, or get confused at how next to consume that bundle programmatically.Example:
I now have a file that looks like this at
current-version.yml
:I want to update my Package CR intelligently to replace
this-thing
with the new bundle image:So that I can maintain a "templated" Package CR that gets stamped out once it has the necessary image reference.
Describe the solution you'd like
I don't have a strong opinion about this, so happy to be moved to a different flow, but I mentally picture something like this:
The kbld config has something to basically tell
this-thing
gets preresolved to the BundleLock, so that instead of attempting to resolvethis-thing
(which would obviously fail) it'll rewrite it to the value passed in.Anything else you would like to add:
I will not know what the tag I am pushing to is, so requiring that to assist with image resolution does not help my use case, although it would probably solve a very similar use case. Also, I do not always push with tags, the example I grabbed just happened to use them.
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.
The text was updated successfully, but these errors were encountered: