Merge a YAML configuration overlay and check sequence changes
Admin ·
A deployment overlay adjusts the service timeout and adds a fallback retry. Apply the overlay to the base configuration with a deliberate rule for the retry sequence, then inspect the generated YAML before using it.
Preserve the base endpoint and check the retry sequence
Load the service example and merge with Replace with overlay and Use overlay value. Confirm that service.endpoint remains localhost, service.timeout becomes 45, and service.retries contains only backup.
Set Sequence handling to Append overlay items and merge again. Check for fast, slow and backup in this order. The overlay adds label as a string with the value 007. The original version stays 9007199254740993 and threshold keeps the literal 1.2300e+04.
service:
endpoint: localhost
timeout: 45
retries:
- fast
- slow
- backup
label: "007"
version: 9007199254740993
threshold: 1.2300e+04
Review the conflicting timeout before export
Change Conflict handling to Report conflicts to stop the download over a value or type conflict. The decision table identifies $.service.timeout. Choose Keep base value to retain 30, or edit both sources to settle the choice before merging again.
Sequence handling is separate. Appending adds all items in source order, including duplicates. Choose replacement when sequence membership itself is the setting provided by the overlay.
Inspect the downloaded types and mapping keys
Open merged.yaml with a YAML 1.2 parser before using it in a deployment. Check the retry order, integer digits and string quotes. YAML 1.2 distinguishes a number from a quoted string, and the meaning of a known field still depends on the application reading it.
Noncyclic aliases expand to their values. The download uses fresh formatting and omits comments. Keep a copy of the original documents if you rely on comments, anchor names or other presentation details.
Common questions
Do duplicate mapping keys within one source count as merge conflicts?
The source must first have unique keys in each mapping. Conflicts compare values at the same path across the two separately validated documents.
Can I merge a YAML stream with multiple documents?
Use one mapping document per side. Choose the base and overlay documents from the stream before merging them.