Take my imgpkg BundleLock and do something magical with it because it's relevant for kbld
- Dominant language
- Go
- Stars
- 329
- Forks
- 52
- PR merge metrics
- No merged PRs in 30d
Description
**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 copy `bundle.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:
```
imgpkg copy -b ${IMGPKG_BUNDLE}:${CHART_VERSION} --to-repo ${IMGPKG_BUNDLE} --lock-output current-version.yml
```
I now have a file that looks like this at `current-version.yml`:
```
---
apiVersion: imgpkg.carvel.dev/v1alpha1
bundle:
image: harbor.example.com/imgpkg/charts/gitlab-runner@sha256:8112e7828ee08c39712a3c598210def3655f5a9778e15fe18277b9455f91af3f
tag: 0.32.0
kind: BundleLock
```
I want to update my Package CR intelligently to replace `this-thing` with the new bundle image:
```
spec:
template:
spec:
fetch:
- imgpkgBundle:
image: this-thing
```
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:
```
imgpkg copy -b ${IMGPKG_BUNDLE}:${CHART_VERSION} --to-repo ${IMGPKG_BUNDLE} --lock-output current-version.yml
kbld -f package-cr.yml -f current-version.yml -f kbld-config.yml > versioned-package-cr.yml
```
The kbld config has something to basically tell `this-thing` gets preresolved to the BundleLock, so that instead of attempting to resolve `this-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.
Contributor guide
Research direction
Start with the kbld command flow shown in the issue and inspect how package-cr.yml, current-version.yml, and kbld-config.yml are consumed together. Define the behavior for replacing a placeholder with the BundleLock bundle.image, including untagged images; done means the example command produces versioned-package-cr.yml without trying to resolve the placeholder.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- cli, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100