pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.19k stars 613 forks source link

Helm: warn on missing docker image #21076

Open lilatomic opened 2 weeks ago

lilatomic commented 2 weeks ago

Add a toggle for warning if something that will be used as an image looks like a target but does not exist. Also adds an option for known 3rd-party images (and the option to disable it).

This allows us to ensure that an image is valid. Obviously, if it's a valid docker_image target, it's valid. Otherwise, the value being passed to an image could fit into several categories, which we can warn about:

closes to #18346

alonsodomin commented 2 weeks ago

Since we're adding a new subsystem that allows to configure the dependency inference behavior. What about having an extra option in the subsystem, some sort of list-option third_party_docker_images?

So if the behavior in helm-infer is something other than ignore, then we would either error or warn whenever we find an image reference that looks like it could either be a target address or a valid external reference but can't find any address for it and it hasn't been listed in that option as an external image reference.

In other words, it would be a safe way of silencing the error/warning without having to change the whole behavior to be ignore. This obviously would need to be highlighted in the documentation otherwise it would take newcomers off-guard.

lilatomic commented 1 week ago

ah, so one wrinkle is that the image refs include values that are passed in as vars and values that are there by default/in the chart. So if you're deploying a helm chart then you might need to add a bunch of images...