Commit Graph

2 Commits

Author SHA1 Message Date
Pieter Noordhuis 414c9fba1f
Pass copy of `dyn.Path` to callback function
Some call sites hold on to the `dyn.Path` provided to them by the callback.
It must therefore never be mutated after the callback returns, or these
mutations leak out into unknown scope.

This change means it is no longer possible for this failure mode to happen.
2024-09-04 15:06:51 +02:00
shreyas-goenka a52b188e99
Use dynamic walking to validate unique resource keys (#1614)
## Changes
This PR:
1. Uses dynamic walking (via the `dyn.MapByPattern` func) to validate no
two resources have the same resource key. The allows us to remove this
validation at merge time.
2. Modifies `dyn.Mapping` to always return a sorted slice of pairs. This
makes traversal functions like `dyn.Walk` or `dyn.MapByPattern`
deterministic.

## Tests
Unit tests. Also manually.
2024-07-29 13:04:02 +00:00