Kustomize
Medium
Mutation
A strategic merge patch lists one container with a new image. What happens to the base's other containers?
Select your answer:
Show answer and explanation
Answer: They stay as they are, because containers are merged by name
Explanation
Strategic merge patches know that containers are keyed by name, so a patch with name: app and a new image only changes that container. A JSON 6902 patch addresses list items by index instead, which breaks when the order changes.
More medium Kustomize questions
- How do you remove a container from a base Deployment with a strategic merge patch?
- When is a JSON 6902 patch a better choice than a strategic merge patch?
- A patch target sets kind: Deployment and labelSelector: tier=backend. Which resources does the patch change?
- What are Kustomize components for?
- Which field replaces the deprecated vars for copying a value from one resource into another?
- How do you reference a base from a Git repository under resources?