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

🔧 Add framework provider #2347

Merged
merged 9 commits into from
Dec 4, 2023
Merged

🔧 Add framework provider #2347

merged 9 commits into from
Dec 4, 2023

Conversation

jrhouston
Copy link
Collaborator

Description

This PR adds a new provider project using Terraform Plugin Framework and muxes with the main and manifest provider. The provider currently does nothing except provide the same provider block configuration interface as the other 2 providers. This provider will be used as a target for code generation.

Acceptance tests

  • Have you added an acceptance test for the functionality being added?
  • Have you run the acceptance tests on this branch?

Output from acceptance testing:

$ make testacc TESTARGS='-run=TestAccXXX'

...

Release Note

Release note for CHANGELOG:

...

References

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

@jrhouston jrhouston marked this pull request as ready for review November 28, 2023 15:28
@jrhouston jrhouston requested a review from a team as a code owner November 28, 2023 15:28
Copy link
Member

@SarahFrench SarahFrench left a comment

Choose a reason for hiding this comment

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

Just left some comments, but generally I'd recommend adding some acceptance tests around how the provider behaves when configured in different ways. Even though this PF provider isn't doing anything (i.e. manages no resources in the provider, yet) it will affect users experience when configuring the provider in their projects and any discrepancy between the two implementations of the provider configuration logic will affect users

// CLI command executed to create a provider server to which the CLI can
// reattach.
var testAccProtoV6ProviderFactories = map[string]func() (tfprotov6.ProviderServer, error){
"kubernetes": providerserver.NewProtocol6WithError(New("test")),
Copy link
Member

Choose a reason for hiding this comment

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

Here protocol 6 is in use, but elsewhere protocol 5 is in use- is that intentional?

And both Alex and I discussed protocol 6 recently and how it requires use of TF v1.0+. If you're adding use of protocol 6 you might need to give users a heads up, as some users do stick with old TF versions for whatever reason.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Not intentional – this came from the scaffolding repo. I'll change it to 5 for now.

framework/provider/provider_configure.go Outdated Show resolved Hide resolved
@@ -51,6 +51,13 @@ func (s *RawProviderServer) PrepareProviderConfig(ctx context.Context, req *tfpr
return resp, nil
}

// GetMetadata function
func (s *RawProviderServer) GetMetadata(ctx context.Context, req *tfprotov5.GetMetadataRequest) (*tfprotov5.GetMetadataResponse, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Not related to the PR, but I'm curious if this function call has to be a singleton among the muxed provider servers.

@arybolovlev
Copy link
Contributor

Could we change the structure here a bit a move this new provider under internal folder?

@jrhouston jrhouston changed the title Add framework provider 🔧 Add framework provider Dec 4, 2023
@jrhouston jrhouston merged commit 3435032 into main Dec 4, 2023
33 of 34 checks passed
@jrhouston jrhouston deleted the add-framework-provider branch December 4, 2023 14:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants