Kustomize
Hard
Generation
A replacement copies metadata.name of a ConfigMap from configMapGenerator into an annotation. The ConfigMap is built as blue-6ct58987ht. What does the annotation get?
Select your answer:
Show answer and explanation
Answer: blue, because hash suffixes are added after replacements run
Explanation
Kustomize adds hash suffixes once, after every kustomization has run its transformers, and replacements are transformers. The upstream test for this case expects blue and links it to issue 4034. References Kustomize tracks, like envFrom and volumes, do get rewritten to the hashed name afterwards.
More hard Kustomize questions
- 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?
- A replacement's source sets kind: ConfigMap and name: cm.*, and the build fails with "nothing selected by". Why?
- 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?