It first showed up as run_as -> nil in the dynamic configuration only to later be converted to run_as -> {} while going through typed conversion. We were using the presence of a key to initialize an empty value. This is incorrect and it should have remained a nil value.
This conversion was happening in convert.FromTyped where any struct always returned a map value. Instead, it should only return a map value in any one of these cases: 1) the struct has elements, 2) the struct was originally a map in the dynamic configuration, or 3) the struct was initialized to a non-empty pointer value.
Stacked on top of #1516 and #1518.
Tests
Unit tests pass.
Integration tests pass.
Manually ran through bundle CRUD with a bundle without resources.
Changes
When a configuration defines:
It first showed up as
run_as -> nil
in the dynamic configuration only to later be converted torun_as -> {}
while going through typed conversion. We were using the presence of a key to initialize an empty value. This is incorrect and it should have remained a nil value.This conversion was happening in
convert.FromTyped
where any struct always returned a map value. Instead, it should only return a map value in any one of these cases: 1) the struct has elements, 2) the struct was originally a map in the dynamic configuration, or 3) the struct was initialized to a non-empty pointer value.Stacked on top of #1516 and #1518.
Tests