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

Correct exporting of the computed attributes for databricks_cluster #1711

Merged
merged 4 commits into from
Nov 4, 2022

Conversation

alexott
Copy link
Contributor

@alexott alexott commented Oct 31, 2022

Some attributes, such as node_type_id are marked as computed and not exported by default. This PR adds a resource-level function that will decide if the resource field needs to be omitted or kept. This function is applied to all fields, not only to computed, so we can avoid exporting defaults, etc.

This fixes #1613

@alexott alexott added the exporter TF configuration generator label Oct 31, 2022
@codecov-commenter
Copy link

codecov-commenter commented Oct 31, 2022

Codecov Report

Merging #1711 (0c04b82) into master (0bffcfe) will increase coverage by 0.04%.
The diff coverage is 97.33%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1711      +/-   ##
==========================================
+ Coverage   89.99%   90.03%   +0.04%     
==========================================
  Files         141      141              
  Lines       11079    11151      +72     
==========================================
+ Hits         9970    10040      +70     
- Misses        707      709       +2     
  Partials      402      402              
Impacted Files Coverage Δ
clusters/clusters_api.go 85.71% <ø> (ø)
exporter/model.go 88.88% <ø> (ø)
exporter/util.go 82.32% <ø> (ø)
exporter/importables.go 90.90% <96.07%> (+0.31%) ⬆️
clusters/resource_cluster.go 85.10% <100.00%> (+0.06%) ⬆️
exporter/context.go 85.94% <100.00%> (+0.15%) ⬆️
repos/resource_repo.go 93.51% <100.00%> (+0.66%) ⬆️
aws/data_aws_bucket_policy.go 94.73% <0.00%> (+0.98%) ⬆️

@alexott alexott force-pushed the exporter-node-type-id-support branch 2 times, most recently from 415c7f2 to 0c04b82 Compare November 2, 2022 18:04
@alexott alexott marked this pull request as ready for review November 3, 2022 10:04
@alexott alexott requested a review from a team November 3, 2022 10:04
@alexott alexott force-pushed the exporter-node-type-id-support branch from 66bbfc0 to 8ec02b1 Compare November 3, 2022 10:06
exporter/util.go Outdated Show resolved Hide resolved
exporter/util.go Outdated Show resolved Hide resolved
exporter/util.go Outdated
}
}
raw := d.Get(pathString)
// log.Printf("[DEBUG] path=%s, raw='%v'", pathString, raw)
Copy link
Contributor

Choose a reason for hiding this comment

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

and here

exporter/util.go Outdated Show resolved Hide resolved
@alexott alexott force-pushed the exporter-node-type-id-support branch from 8ec02b1 to e72d4cf Compare November 4, 2022 16:58
@alexott alexott requested a review from nfx November 4, 2022 16:58
@alexott
Copy link
Contributor Author

alexott commented Nov 4, 2022

@nfx code is cleaned up

@nfx nfx enabled auto-merge (squash) November 4, 2022 17:01
@nfx nfx merged commit c297ca3 into master Nov 4, 2022
@nfx nfx mentioned this pull request Nov 7, 2022
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
exporter TF configuration generator
Projects
None yet
Development

Successfully merging this pull request may close these issues.

node_type_id was not exported from the terraform exporter.
3 participants