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

Migrated databricks_cluster resource to Go SDK #3376

Merged
merged 29 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
ef90181
-
tanmay-db Mar 15, 2024
ae09a53
-
tanmay-db Mar 15, 2024
dc3d19e
-
tanmay-db Mar 15, 2024
3d92135
-
tanmay-db Mar 15, 2024
85e0d3e
-
tanmay-db Mar 15, 2024
e693918
-
tanmay-db Mar 15, 2024
b12e8e8
-
tanmay-db Mar 15, 2024
97d4de8
passing clusters unit test
tanmay-db Mar 18, 2024
41ddd03
passing clusters integration test
tanmay-db Mar 18, 2024
1dc63ea
Remove and fix libraries in jobs, pipelines, exporter
tanmay-db Mar 18, 2024
d66d953
Merge branch 'main' of github.com:databricks/terraform-provider-datab…
tanmay-db Mar 18, 2024
634fbc1
cleanup
tanmay-db Mar 18, 2024
9e31da7
All unit tests passing
tanmay-db Mar 19, 2024
279f60e
All unit tests passing
tanmay-db Mar 19, 2024
16062ce
Merge branch 'main' of github.com:databricks/terraform-provider-datab…
tanmay-db Mar 19, 2024
4e8afc0
-
tanmay-db Mar 19, 2024
ebe5124
cleanup
tanmay-db Mar 19, 2024
ae843d7
Merge branch 'main' of github.com:databricks/terraform-provider-datab…
tanmay-db Mar 22, 2024
17956cd
use wrapper in meantime go sdk change is merged
tanmay-db Mar 25, 2024
cbcfc68
Merge branch 'main' of github.com:databricks/terraform-provider-datab…
tanmay-db Mar 25, 2024
b83b2eb
Merge branch 'main' of github.com:databricks/terraform-provider-datab…
tanmay-db Apr 2, 2024
78634d8
upd to main
tanmay-db Apr 4, 2024
1659589
comments
tanmay-db Apr 11, 2024
ef902ff
Merge branch 'main' of github.com:databricks/terraform-provider-datab…
tanmay-db Apr 11, 2024
652ee69
comments
tanmay-db Apr 11, 2024
c1e8a3d
-
tanmay-db Apr 11, 2024
b670d4c
-
tanmay-db Apr 11, 2024
6278c65
-
tanmay-db Apr 11, 2024
4d88b38
-
tanmay-db Apr 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions clusters/clusters_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,8 @@ type Cluster struct {
ClusterMounts []MountInfo `json:"cluster_mount_infos,omitempty" tf:"alias:cluster_mount_info"`
}

// TODO: Remove this once all the resources using clusters are migrated to Go SDK.
// They would then be using Validate(cluster compute.CreateCluster) defined in resource_cluster.go that is a duplicate of this method but uses Go SDK.
func (cluster Cluster) Validate() error {
// TODO: rewrite with CustomizeDiff
if cluster.NumWorkers > 0 || cluster.Autoscale != nil {
Expand All @@ -447,6 +449,8 @@ func (cluster Cluster) Validate() error {
return fmt.Errorf("NumWorkers could be 0 only for SingleNode clusters. See https://docs.databricks.com/clusters/single-node.html for more details")
}

// TODO: Remove this once all the resources using clusters are migrated to Go SDK.
// They would then be using ModifyRequestOnInstancePool(cluster *compute.CreateCluster) defined in resource_cluster.go that is a duplicate of this method but uses Go SDK.
// ModifyRequestOnInstancePool helps remove all request fields that should not be submitted when instance pool is selected.
func (cluster *Cluster) ModifyRequestOnInstancePool() {
// Instance profile id does not exist or not set
Expand Down Expand Up @@ -477,6 +481,8 @@ func (cluster *Cluster) ModifyRequestOnInstancePool() {
cluster.DriverNodeTypeID = ""
}

// TODO: Remove this once all the resources using clusters are migrated to Go SDK.
// They would then be using FixInstancePoolChangeIfAny(d *schema.ResourceData, cluster compute.CreateCluster) defined in resource_cluster.go that is a duplicate of this method but uses Go SDK.
// https://github.com/databricks/terraform-provider-databricks/issues/824
func (cluster *Cluster) FixInstancePoolChangeIfAny(d *schema.ResourceData) {
oldInstancePool, newInstancePool := d.GetChange("instance_pool_id")
Expand Down
Loading
Loading