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

Support and populate discriminator metadata #1849

Open
t0yv0 opened this issue Nov 25, 2024 · 0 comments
Open

Support and populate discriminator metadata #1849

t0yv0 opened this issue Nov 25, 2024 · 0 comments
Labels
kind/enhancement Improvements or new features

Comments

@t0yv0
Copy link
Member

t0yv0 commented Nov 25, 2024

Hello!

  • Vote on this issue by adding a 👍 reaction
  • If you want to implement this feature, comment to let us know (we'll work with you on design, scheduling, etc.)

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

@t0yv0 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
Labels
kind/enhancement Improvements or new features
Projects
None yet
Development

No branches or pull requests

1 participant