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

Fix defaults v mutually exclusive args conflict #813

Merged
merged 7 commits into from
Nov 18, 2022

Conversation

roothorp
Copy link
Contributor

@roothorp roothorp commented Nov 16, 2022

PR #641 added a default value to the Cluster argument nodeRootVolumeSize, which causes all the generated SDKs to give this field a default value if not supplied. However,

if (args.nodeGroupOptions && (
checks that either the argument nodeGroupOptions or individual arguments including nodeRootVolumeSize are provided, and not both. Since nodeRootVolumeSize always has a value, this means that if you supply nodeGroupOptions, it will fail to create your cluster.

On the basis that the platform applies the default and the SDK does not need to, this PR removes the default for that specific field from the schema.

Fixes #643.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

3 similar comments
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@squaremo squaremo changed the title Fix SDK Defaults Fix defaults v mutually exclusive args conflict Nov 16, 2022
Copy link
Contributor

@squaremo squaremo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks right and good and nicely self-contained to me. As a co-author though, I'll leave the official green-ticking to Daniel.

@danielrbradley
Copy link
Member

I think this approach is all correct, but I think we should probably remove all default values in the schema. We never want the SDK providing a default value rather - we're rather the SDK passes through the lack of value and let the nodejs implementation calculate the defaults provider-side.

Roo Thorp added 5 commits November 16, 2022 15:46
Previously a default for nodeRootVolumeSize was set in the schema (and therefore the SDKs),
which would mean the value was always set. This would cause the mutual exclusion check for
nodeGroupOptions to always fail if nodeGroupOptions was ever supplied. This is not needed,
as the platform itself defaults the value.
@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@github-actions
Copy link

Does the PR have any schema changes?

Looking good! No breaking changes found.
No new resources/functions.

@roothorp roothorp merged commit 8128538 into master Nov 18, 2022
@pulumi-bot pulumi-bot deleted the roothorp/fix-defaults branch November 18, 2022 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

SDK default values cause validation failures
3 participants