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
When a subobject exists only in preview versions of a resource, and that subobject references another object that exists across both preview and stable versions of that resource, we generate invalid conversion code that does not compile.
To Reproduce
Discovered when importing a second preview version of containerserviceManagedCluster.
The subobject ManagedClusterIngressProfileWebAppRouting_STATUS exists only in preview versions of ManagedCluster. It's conversion graph is:
When converting the field ManagedClusterIngressProfileWebAppRouting_STATUS.Identity, of type UserAssignedIdentity_STATUS, we need to convert between versions v20230702ps and v20230202ps.
However, UserAssignedIdentity_STATUS exists in stable versions as well, and has this conversion graph:
Currently the code generator expects to always follow conversions in the same direction, either forwards or backwards.
From v20230702ps it converts forward to v20230701s and then it expects to convert forward from there, which is impossible.
Expected behavior
After conversion to v20230701s, the generated code should work backwards, converting first to v20230201s and then to the final version v20230202ps.
Additional context
Additional bugness: this illegal situation shouldn't have ever generated bad code - it should have returned an error.
The text was updated successfully, but these errors were encountered:
Describe the bug
When a subobject exists only in preview versions of a resource, and that subobject references another object that exists across both preview and stable versions of that resource, we generate invalid conversion code that does not compile.
To Reproduce
Discovered when importing a second preview version of
containerservice
ManagedCluster
.The subobject
ManagedClusterIngressProfileWebAppRouting_STATUS
exists only in preview versions ofManagedCluster
. It's conversion graph is:When converting the field
ManagedClusterIngressProfileWebAppRouting_STATUS.Identity
, of typeUserAssignedIdentity_STATUS
, we need to convert between versionsv20230702ps
andv20230202ps
.However,
UserAssignedIdentity_STATUS
exists in stable versions as well, and has this conversion graph:Currently the code generator expects to always follow conversions in the same direction, either forwards or backwards.
From
v20230702ps
it converts forward tov20230701s
and then it expects to convert forward from there, which is impossible.Expected behavior
After conversion to
v20230701s
, the generated code should work backwards, converting first tov20230201s
and then to the final versionv20230202ps
.Additional context
Additional bugness: this illegal situation shouldn't have ever generated bad code - it should have returned an error.
The text was updated successfully, but these errors were encountered: