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 config.Provider.GetSkippedResourceNames #137

Merged
merged 2 commits into from
Nov 11, 2022

Conversation

ulucinar
Copy link
Collaborator

@ulucinar ulucinar commented Nov 10, 2022

Description of your changes

This PR proposes to add a config.Provider.GetSkippedResourceNames method that returns a list of Terraform resource names that are available in the Terraform provider schema but that are either skipped or not included so that they are not generated as managed resources.

I've also considered:

  • Directly generating the diff file when a path is configured (via provider configuration). But generating this diff, in my opinion, would be a supporting function (not among the core code generation pipelines), so instead of configuring a file path to store the diff and having Upjet generate it, I preferred a change to make Upjet be able to directly supply the required diff information
  • Another approach would be not to touch Upjet but instead do the diff calculation in the providers themselves. In the provider, we already have the JSON schema from which we can extract the set of Terraform resources available and also the names of the Terraform resources for which we have generated the corresponding MRs (in the generated files under apis). But I found this approach too indirect and requiring further processing for a directly available piece of information. Thus I went with the small change proposed in this PR.

I have:

  • Read and followed Crossplane's contribution process.
  • Run make reviewable to ensure this PR is ready for review.
  • Added backport release-x.y labels to auto-backport this PR if necessary.

How has this code been tested

Tested against upbound/provider-aws.

…rraform resource names

that are available in the Terraform schema but not generated

Signed-off-by: Alper Rifat Ulucinar <[email protected]>
pkg/config/provider.go Outdated Show resolved Hide resolved
@ulucinar
Copy link
Collaborator Author

Closing/reopening the PR in an attempt to retrigger the CLA check...

@ulucinar ulucinar closed this Nov 11, 2022
@ulucinar ulucinar reopened this Nov 11, 2022
@jeanduplessis jeanduplessis merged commit 6de200a into crossplane:main Nov 11, 2022
@ulucinar ulucinar deleted the fix-867 branch November 11, 2022 12:35
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.

3 participants