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

Added LocalSsdCount in GcpAttributes to ForceSendFields for databricks_cluster resource #3631

Merged
merged 2 commits into from
May 30, 2024

Conversation

tanmay-db
Copy link
Contributor

Changes

We always force send the local ssd count if gcp attribute is specified.

Tests

Updated unit test

  • make test run locally
  • relevant change in docs/ folder
  • covered with integration tests in internal/acceptance
  • relevant acceptance tests are passing
  • using Go SDK

@tanmay-db tanmay-db requested review from a team as code owners May 30, 2024 13:56
@tanmay-db tanmay-db requested review from mgyucht, andrewnester and edwardfeng-db and removed request for a team May 30, 2024 13:56
@tanmay-db tanmay-db changed the title Added LocalSsdCount in GcpAttributes to ForceSendFields Added LocalSsdCount in GcpAttributes to ForceSendFields for databricks_cluster resource May 30, 2024
Copy link
Contributor

@edwardfeng-db edwardfeng-db left a comment

Choose a reason for hiding this comment

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

Great, thanks!

@andrewnester
Copy link
Contributor

Does it mean it will send LocalSsdCount always even if not explicitly specified in terraform file? Or we do some GetOkExists checks somewhere?

@@ -383,6 +383,9 @@ func resourceClusterCreate(ctx context.Context, d *schema.ResourceData, c *commo
if createClusterRequest.Autoscale == nil {
createClusterRequest.ForceSendFields = []string{"NumWorkers"}
}
if createClusterRequest.GcpAttributes != nil {
createClusterRequest.GcpAttributes.ForceSendFields = []string{"LocalSsdCount"}
Copy link
Contributor

Choose a reason for hiding this comment

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

We should call GetOkExists for local_ssd_count to check that it was explicitly set and only then send it. The reason is that if not specified in request, the default value for local_ssd_count on backend is not 0 (can be 1, 2, 4 depending on type of instance used).

@tanmay-db tanmay-db requested a review from andrewnester May 30, 2024 15:42
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 3 lines in your changes are missing coverage. Please review.

Project coverage is 81.65%. Comparing base (453d941) to head (5f4c6d3).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3631      +/-   ##
==========================================
- Coverage   81.65%   81.65%   -0.01%     
==========================================
  Files         193      193              
  Lines       19536    19539       +3     
==========================================
+ Hits        15953    15955       +2     
- Misses       2633     2634       +1     
  Partials      950      950              
Files Coverage Δ
clusters/resource_cluster.go 70.53% <0.00%> (-0.46%) ⬇️

... and 1 file with indirect coverage changes

@tanmay-db tanmay-db added this pull request to the merge queue May 30, 2024
Merged via the queue into main with commit 88bcc65 May 30, 2024
5 checks passed
@tanmay-db tanmay-db deleted the fix-ssd-count branch May 30, 2024 15:48
@tanmay-db tanmay-db mentioned this pull request May 30, 2024
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.

4 participants