You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 6295e02
Browse filesBrowse the repository at this point in the historyBrowse files
test(engine): deep-copy chart values in render helpers
Address review feedback from gemini-code-assist on
pkg/engine/render_test.go:71:
maps.Copy does a shallow copy of chrt.Values. Today's tests only
mutate top-level keys, but a future contributor writing something
like `values["podSubnets"] = append(values["podSubnets"].([]any), x)`
could corrupt chrt.Values via the shared slice's backing array, and
downstream tests loading the same chart would pick up the mutation.
Introduce cloneValues — a small recursive deep-copy handling maps,
slices, and primitives — and use it in the renderCozystackWith,
renderGenericWith, and renderChartTemplate helpers where chrt.Values
is the starting point. The existing maps.Copy for merging in caller-
supplied overrides is kept; overrides maps are built fresh per test
so they are already safe.
Assisted-By: Claude <[email protected]>
Signed-off-by: Aleksei Sviridkin <[email protected]>
0 commit comments