-
Notifications
You must be signed in to change notification settings - Fork 16
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
Support and populate discriminator metadata #1849
Labels
kind/enhancement
Improvements or new features
Comments
t0yv0
added
kind/enhancement
Improvements or new features
needs-triage
Needs attention from the triage team
and removed
needs-triage
Needs attention from the triage team
labels
Nov 25, 2024
t0yv0
added a commit
that referenced
this issue
Nov 25, 2024
This change fixes the conversion of Pulumi input properties to the format expected by the CloudControl API in the case when Pulumi schema specifies a union type (OneOf) without a discriminator. Previously the first matching case would be picked which could erroneously send empty data to CloudControl. With this change a heuristic is run instead to pick the non-error case with the largest map or array. In the long term it would be better to support discriminators and manage their metadata (#1849). Fixes #1846
t0yv0
added a commit
that referenced
this issue
Nov 25, 2024
This change fixes the conversion of Pulumi input properties to the format expected by the CloudControl API in the case when Pulumi schema specifies a union type (OneOf) without a discriminator. Previously the first matching case would be picked which could erroneously send empty data to CloudControl. With this change a heuristic is run instead to pick the non-error case with the largest map or array. In the long term it would be better to support discriminators and manage their metadata (#1849). Fixes #1846
t0yv0
added a commit
that referenced
this issue
Nov 25, 2024
This change fixes the conversion of Pulumi input properties to the format expected by the CloudControl API in the case when Pulumi schema specifies a union type (OneOf) without a discriminator. Previously the first matching case would be picked which could erroneously send empty data to CloudControl. With this change a heuristic is run instead to pick the non-error case with the largest map or array. In the long term it would be better to support discriminators and manage their metadata (#1849). Fixes #1846
t0yv0
added a commit
that referenced
this issue
Nov 25, 2024
This change fixes the conversion of Pulumi input properties to the format expected by the CloudControl API in the case when Pulumi schema specifies a union type (OneOf) without a discriminator. Previously the first matching case would be picked which could erroneously send empty data to CloudControl. With this change a heuristic is run instead to pick the non-error case with the largest map or array. In the long term it would be better to support discriminators and manage their metadata (#1849). Fixes #1846
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello!
Issue details
When converting data from Pulumi to the format expected by CloudControl, if Pulumi schema specifies a union type with several cases, the cases may be ambiguous and SdkToCfn will pick the first non-erroring case. In some situations this is not good enough and will pick an incorrect case. Ideally the provider should implement support for the Discriminator field of the Pulumi Package schema and update the schema accordingly by populating this field where appropriate.
Affected area/feature
The text was updated successfully, but these errors were encountered: