carvel-dev / kbld

kbld seamlessly incorporates image building and image pushing into your development and deployment workflows
https://carvel.dev/kbld
Apache License 2.0
292 stars 39 forks source link

support a way to verify that all images are preresolved #78

Open cppforlife opened 3 years ago

cppforlife commented 3 years ago

Describe the problem/challenge you have

when applying a lock file that preresolves all images, it may be useful to verify that all found images by kbld have indeed been preresolved by the config. this would help finding problematic config (of images) before they get deployed to the cluster and potentially cannot be downloaded.

Describe the solution you'd like

add optional --expect-all-preresolved=bool flag (default false). can it be noun-ized further?

Anything else you would like to add:

n/a

danielhelfand commented 3 years ago

I think the feature sounds like a good safety measure for users. Just had a thought below.

So with this feature, I would have something like the following:

kbld -f manifest.yml -f /path/to/imageslock/images.yml --expect-all-preresolved

If the validation by kbld from --expect-all-preresolved succeeds, then I would expect to be able to immediately after pipe to kapp? Or if --expect-all-preresolved succeeds, I would get a confirmation message that all images are resolved or an error for failure?

Just mainly trying to see if this is intended to be more like a plan or dry run option. My thought is that is not what is being asked for, but just wanted to clarify.

voor commented 3 years ago

The intention is that this will provide an early warning mechanism for my use case, which is all images are relocated with kbld and a failure to identify an image being relocated is a guarantee that the next step in the "chain" will fail, most likely due to an Image Pull Failure. This would be leveraged in kapp-controller, so kapp would immediately follow kbld.

danielhelfand commented 3 years ago

Thanks @voor for the clarification on relocation/having kapp-controller as the driving use case.

cppforlife commented 3 years ago

If the validation by kbld from --expect-all-preresolved succeeds, then I would expect to be able to immediately after pipe to kapp

yup. if it fails it will fail, and kapp will receive 0 resources and error out as well.