databricks-cli/libs/dyn/dynvar
Pieter Noordhuis 5f59572cb3
Fix issue where interpolating a new ref would rewrite unrelated fields (#1217)
## Changes

When resolving a value returned by the lookup function, the code would
call into `resolveRef` with the key that `resolveKey` was called with.
In doing so, it would cache the _new_ ref under that key.

We fix this by caching ref resolution only at the top level and relying
on lookup caching to avoid duplicate work.

This came up while testing #1098.

## Tests

Unit test.
2024-02-16 16:19:40 +00:00
..
lookup.go Add `dynvar` package for variable resolution with a `dyn.Value` tree (#1143) 2024-01-24 18:49:06 +00:00
lookup_test.go Add `dynvar` package for variable resolution with a `dyn.Value` tree (#1143) 2024-01-24 18:49:06 +00:00
ref.go Add `dynvar` package for variable resolution with a `dyn.Value` tree (#1143) 2024-01-24 18:49:06 +00:00
ref_test.go Add `dynvar` package for variable resolution with a `dyn.Value` tree (#1143) 2024-01-24 18:49:06 +00:00
resolve.go Fix issue where interpolating a new ref would rewrite unrelated fields (#1217) 2024-02-16 16:19:40 +00:00
resolve_test.go Fix issue where interpolating a new ref would rewrite unrelated fields (#1217) 2024-02-16 16:19:40 +00:00