In #3805, @nojnhuh noticed that asoctl was initializing the type field on an imported AgentPool with the wrong value.
Investigation leads to the observation that properties with the same name don't necessarily have the same providence - not every Type field can be copied into another Type field.
Special notes for your reviewer:
There are two fixes.
The first is to check the origin of each property, skipping the assign-identically-named-properties step if the properties came from different places
The second fix is to use the path-of-origin of the remaining properties to match things up. This is complicated by the possibility that the property may be configurable - so we would have both Type and TypeFromConfig as candidates. We disambiguate these by doing a fast and loose compatibility check on the types, which seems good enough.
What this PR does / why we need it:
In #3805, @nojnhuh noticed that
asoctl
was initializing thetype
field on an imported AgentPool with the wrong value.Investigation leads to the observation that properties with the same name don't necessarily have the same providence - not every
Type
field can be copied into anotherType
field.Special notes for your reviewer:
There are two fixes.
The first is to check the origin of each property, skipping the assign-identically-named-properties step if the properties came from different places
The second fix is to use the path-of-origin of the remaining properties to match things up. This is complicated by the possibility that the property may be configurable - so we would have both
Type
andTypeFromConfig
as candidates. We disambiguate these by doing a fast and loose compatibility check on the types, which seems good enough.How does this PR make you feel:
If applicable: