-
Notifications
You must be signed in to change notification settings - Fork 136
Add --allow_unused_images resolver flag #161
Comments
--allow_unused_images
resolver arg, and support for passing it
Can you give a concrete example of what you mean by multiple SKUs? The image reference not found is usually an important safeguard against launching the wrong image and image typos. |
/assign |
As a safeguard, it's a bit like a very sturdy guard rail on only one side of a road with cliffs on both sides. :-) (See #147) However, this change still leaves the guard rail on by default and just allows it to be disabled when it's more trouble than its worth. Example: Let's say you want to generate deployment targets for the same service across multiple environments. To do this:
The problem arises when a service uses an image in only some environments. This is pretty common in test vs. production environments. In this case the k8s_object targets will fail in environments that don't use a listed image. |
@fejta: Friendly ping! |
Background
Some macros will instantiate
k8s_object(...)
multiple times with different SKUs. When an image is only used by some SKUs and not others, the default resolver dies when it doesn't find the image in a particular SKU's template:rules_k8s/k8s/resolver.py
Lines 190 to 195 in 4348f8e
For cases like this, it would be nice to be able to relax the unused image error.
Proposal
Add an
--allow_unused_images
flag toresolver.py
. Add aresolver_args
parameter tok8s_object
that allows arguments to be passed directly to the resolver. This would be useful for custom resolvers as well.The text was updated successfully, but these errors were encountered: