Kustomize
Hard
Mutation
A JSON 6902 patch adds an annotation named example.com/owner. How is that key written in the patch path?
Select your answer:
Show answer and explanation
Answer: /metadata/annotations/example.com~1owner
Explanation
JSON Pointer escapes / as ~1 and ~ as ~0. Without the escape, the path points at a key named owner nested under example.com, and the patch fails or lands in the wrong place.
More hard Kustomize questions
- Why can a kustomization build with the kustomize CLI but fail with kubectl apply -k?
- Why does generatorOptions.immutable: true work well with Kustomize's default hash suffix?
- Why can a component patch resources defined in the overlay that includes it, when a base can't?
- Which field path selects the value of the env var SERVICE_HOST in the container named app, for a replacement target?
- A production overlay lists a remote base with ?ref=main. What's the risk?
- A strategic merge patch adds one item to a list in a custom resource, but the build replaces the whole list. Why?