Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Invalid code generation for preview subobjects #3612

Closed
theunrepentantgeek opened this issue Nov 29, 2023 · 1 comment
Closed

Bug: Invalid code generation for preview subobjects #3612

theunrepentantgeek opened this issue Nov 29, 2023 · 1 comment
Assignees
Labels
bug 🪲 Something isn't working
Milestone

Comments

@theunrepentantgeek
Copy link
Member

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 of ManagedCluster. It's conversion graph is:

image

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:

image

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.

@theunrepentantgeek
Copy link
Member Author

Resolved by #3641

@github-project-automation github-project-automation bot moved this from Up Next to Recently Completed in Azure Service Operator Roadmap Feb 12, 2024
@matthchr matthchr moved this from Recently Completed to Ready for Release in Azure Service Operator Roadmap Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working
Projects
Development

No branches or pull requests

2 participants