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

Respect the version option for provider resources. #6055

Merged
merged 4 commits into from
Jan 5, 2021

Conversation

pgavlin
Copy link
Member

@pgavlin pgavlin commented Jan 5, 2021

Although raw provider resources accept an input that allows a user to
specifiy a provider version to use, this input is not reflected in
current SDK code generation. Furthermore, we already have a method to
specify the provider version that should be used for a resource: the
"version" resource option. These changes update the code that handles
provider resource registrations to autmoatically populate the version
input from the "version" resource option if the option is present.

Fixes pulumi/pulumi-azure#803.

Although raw provider resources accept an input that allows a user to
specifiy a provider version to use, this input is not reflected in
current SDK code generation. Furthermore, we already have a method to
specify the provider version that should be used for a resource: the
"version" resource option. These changes update the code that handles
provider resource registrations to autmoatically populate the version
input from the "version" resource option if the option is present.

Fixes pulumi/pulumi-azure#803.
}
p.Run(t, nil)

assert.Equal(t, "1.5.0", version)
Copy link
Member

Choose a reason for hiding this comment

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

This took me awhile to wrap my head around. IIUC, the version variable is captured by the function closures in the loaders slice so that it gets set when the loader runs? Might be worth adding a comment about that.

@pgavlin pgavlin merged commit e1ac01a into master Jan 5, 2021
@pulumi-bot pulumi-bot deleted the pgavlin/providerVersion branch January 5, 2021 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants