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

Fixed incorrect diff for num_clusters and min_num_clusters for stopped databricks_sql_endpoint #1927

Merged
merged 2 commits into from
Jan 16, 2023

Conversation

nfx
Copy link
Contributor

@nfx nfx commented Jan 16, 2023

Correctly suppress diff for num_clusters on warehouses that are not running, in case num_clusters is not specified.

Note for contributors: tf:"suppress_diff" and tf:"default" don't work well together.

Fixes #1204 #1743

Correctly suppress diff for `num_clusters` on warehouses that are not running, in case `num_clusters` is not specified.

Note for contributors: `tf:"suppress_diff"` and `tf:"default"` don't work well together.

Fix #1204
@nfx nfx requested review from a team January 16, 2023 11:16
@nfx nfx enabled auto-merge (squash) January 16, 2023 11:16
Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

tests are failing :-)
plus we need to do the same for MinNumClusers.

Plus, maybe it makes sense to add .AtLeastOneOf to num_clusers and min_num_clusters?

@@ -27,7 +27,7 @@ type SQLEndpoint struct {
AutoStopMinutes int `json:"auto_stop_mins" tf:"optional,default:120"`
MinNumClusters int `json:"min_num_clusters,omitempty" tf:"default:1,suppress_diff"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we do the same for MinNumClusters ?

@nfx nfx changed the title Fixed incorrect diff for num_clusters for stopped databricks_sql_endpoint Fixed incorrect diff for num_clusters and min_num_clusters for stopped databricks_sql_endpoint Jan 16, 2023
@nfx nfx disabled auto-merge January 16, 2023 11:33
@nfx nfx enabled auto-merge (squash) January 16, 2023 11:33
@nfx nfx requested a review from alexott January 16, 2023 11:33
@nfx
Copy link
Contributor Author

nfx commented Jan 16, 2023

@alexott having a sound CI system makes me sometimes forget running tests locally.

Added the same fix for min_num_clusters. not really willing to . AtLeastOneOf because the validation should happen on the backend.

@nfx nfx linked an issue Jan 16, 2023 that may be closed by this pull request
Copy link
Contributor

@alexott alexott left a comment

Choose a reason for hiding this comment

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

lgtm

@nfx nfx merged commit eab72bb into master Jan 16, 2023
@nfx nfx deleted the fix/1204 branch January 16, 2023 11:42
nfx added a commit that referenced this pull request Jan 17, 2023
# Version changelog

### 1.9.0

 * Added [databricks_mws_credentials](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/mws_credentials) data source ([#1909](#1909)).
 * Fixed incorrect diff for `num_clusters` and `min_num_clusters` for stopped [databricks_sql_endpoint](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/sql_endpoint) ([#1927](#1927)).
 * Fixed `privilege_assignment` in [databricks_sql_permissions](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/sql_permissions) ([#1872](#1872)).
 * Documentation improvements ([#1921](#1921), [#1923](#1923)).

Updated dependency versions:

 * Bump github.com/hashicorp/go-retryablehttp from 0.7.1 to 0.7.2 ([#1913](#1913)).
 * Bump google.golang.org/api from 0.105.0 to 0.106.0 ([#1914](#1914)).
@nfx nfx mentioned this pull request Jan 17, 2023
nfx added a commit that referenced this pull request Jan 17, 2023
# Version changelog

### 1.9.0

 * Added [databricks_mws_credentials](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/mws_credentials) data source ([#1909](#1909)).
 * Fixed incorrect diff for `num_clusters` and `min_num_clusters` for stopped [databricks_sql_endpoint](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/sql_endpoint) ([#1927](#1927)).
 * Fixed `privilege_assignment` in [databricks_sql_permissions](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/sql_permissions) ([#1872](#1872)).
 * Documentation improvements ([#1921](#1921), [#1923](#1923)).

Updated dependency versions:

 * Bump github.com/hashicorp/go-retryablehttp from 0.7.1 to 0.7.2 ([#1913](#1913)).
 * Bump google.golang.org/api from 0.105.0 to 0.106.0 ([#1914](#1914)).
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
…opped `databricks_sql_endpoint` (databricks#1927)

Correctly suppress diff for `num_clusters` on warehouses that are not running, in case `num_clusters` is not specified.

Note for contributors: `tf:"suppress_diff"` and `tf:"default"` don't work well together.
michael-berk pushed a commit to michael-berk/terraform-provider-databricks that referenced this pull request Feb 15, 2023
# Version changelog

### 1.9.0

 * Added [databricks_mws_credentials](https://registry.terraform.io/providers/databricks/databricks/latest/docs/data-sources/mws_credentials) data source ([databricks#1909](databricks#1909)).
 * Fixed incorrect diff for `num_clusters` and `min_num_clusters` for stopped [databricks_sql_endpoint](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/sql_endpoint) ([databricks#1927](databricks#1927)).
 * Fixed `privilege_assignment` in [databricks_sql_permissions](https://registry.terraform.io/providers/databricks/databricks/latest/docs/resources/sql_permissions) ([databricks#1872](databricks#1872)).
 * Documentation improvements ([databricks#1921](databricks#1921), [databricks#1923](databricks#1923)).

Updated dependency versions:

 * Bump github.com/hashicorp/go-retryablehttp from 0.7.1 to 0.7.2 ([databricks#1913](databricks#1913)).
 * Bump google.golang.org/api from 0.105.0 to 0.106.0 ([databricks#1914](databricks#1914)).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants