Helm: warn on missing docker image
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:
- a 3rd party image : we check that this is a known image, so
busybox:latestisn't interpreted as a target - an image that was produced by a
docker_imagetarget, but taken from the registry :myproject/docker:1.0.0. we treat is as a 3rd party chart, which isn't accurate but has the same outcome. - something that is obviously a Pants target but that isn't found :
//myproject:oops, which we can warn must be a typo - targets of the wrong type :
myproject:files
closes to #18346
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.
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...
I wonder though why we need the wildcard
*inexternal_docker_imagesas that gives two different ways of silencing errors/warnings about unknown docker image references.
There's a bit of a subtlety in that the wildcard will only "pass" on things that look like docker images, but will still error on other things, like something that looks like an address but didn't resolve. I've added that as a doc.