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

Ensure forward build compatibility for resource provider #444

Merged
merged 1 commit into from
Dec 12, 2022

Conversation

AaronFriel
Copy link
Contributor

@AaronFriel AaronFriel commented Dec 10, 2022

See: pulumi/pulumi#11616

This change ensures the Docker provider is source-code forward compatible with future changes to the gRPC interfaces for providers upstream. This reduces the likelihood that source code changes are needed when updating to new Pulumi SDK/PKG versions.

The same change is being made in the bridge and other providers to ensure that CI systems can reliably build and test new versions of the core Pulumi engine against providers.

@github-actions
Copy link

Does the PR have any schema changes?

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

Copy link
Contributor

@guineveresaenger guineveresaenger left a comment

Choose a reason for hiding this comment

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

Could you please provide a top-level summary in this pull request? You linked to a p/p change, where you describe the problem being addressed, but could you describe the solution as well, and also any implications for this provider?

Do we need to add anything like this to the terraform bridge?

@AaronFriel
Copy link
Contributor Author

AaronFriel commented Dec 12, 2022

@guineveresaenger I've added some context, but the tracking issue should be the "source of truth", IMO. Otherwise we'll end up duplicating a lot of information across different threads. The tracking issue has a PR against the bridge, which is already merged.

The implication for this provider is that it avoids the following error message, which you would see if you updated to the latest pulumi/pulumi/sdk/v3:

./serve.go:33:9: cannot use &dockerHybridProvider{…} (value of type *dockerHybridProvider) as type pulumirpc.ResourceProviderServer in return statement:
        *dockerHybridProvider does not implement pulumirpc.ResourceProviderServer (missing GetMapping method)
./serve.go:37:20: cannot use nativeProvider (variable of type *dockerNativeProvider) as type pulumirpc.ResourceProviderServer in struct literal:
        *dockerNativeProvider does not implement pulumirpc.ResourceProviderServer (missing GetMapping method)

By embedding the UnimplementedResourceProviderServer type in dockerHybridProvider and dockerNativeProvider, those types gain default implementations of the GetMapping method.

Copy link
Contributor

@guineveresaenger guineveresaenger left a comment

Choose a reason for hiding this comment

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

Thank you!!

@AaronFriel AaronFriel merged commit 5bc1207 into master Dec 12, 2022
@AaronFriel AaronFriel deleted the friel/fwd-compat branch December 12, 2022 20:19
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.

2 participants