# 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?

Kustomize, Hard (Expert), Troubleshooting. https://k8wiz.com/uquiz/a-pod-has-containers-named-web-and-web-sidecar-a-replacement-target-uses-the-path-speccontainersnamewebimage-which-containers-ge

- A. Only web, because [name=web] compares the name exactly
- B. Neither, because the match must be written as [name=^web]
- C. Both, because the value in [name=web] is an unanchored regex
- D. Only the first container in the list whose name matches web

**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.
