k8wiz
Kustomize
Hard
Troubleshooting

A pod has containers named web and web-sidecar. A replacement target uses the path spec.containers.[name=web].image. Which containers get the new image?

Select your answer:

Show answer and explanation

Answer: Both, because the value in [name=web] is an unanchored regex

Explanation

In current Kustomize the value in a [key=value] path segment is matched as a regular expression, and every matching list item is a target. web matches web-sidecar too. Write [name=^web$] to hit only the container named web.

Read more about Kustomize