Skip to content

Commit

Permalink
tidy up
Browse files Browse the repository at this point in the history
  • Loading branch information
nkvuong committed Jul 2, 2024
1 parent 57b73d8 commit dd78ab8
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
4 changes: 4 additions & 0 deletions catalog/resource_sql_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1254,6 +1254,10 @@ var baseClusterFixture = []qa.HTTPFixture{
Key: "7.1.x-cpu-ml-scala2.12",
Name: "7.1 ML (includes Apache Spark 3.0.0, Scala 2.12)",
},
{
Key: "7.3.x-scala2.12",
Name: "7.3 LTS (includes Apache Spark 3.0.1, Scala 2.12)",
},
},
},
},
Expand Down
14 changes: 6 additions & 8 deletions clusters/clusters_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -881,7 +881,6 @@ var getOrCreateClusterMutex sync.Mutex

// GetOrCreateRunningCluster creates an autoterminating cluster if it doesn't exist
func (a ClustersAPI) GetOrCreateRunningCluster(name string, custom ...Cluster) (c ClusterInfo, err error) {
w, err := a.client.WorkspaceClient()
getOrCreateClusterMutex.Lock()
defer getOrCreateClusterMutex.Unlock()

Expand Down Expand Up @@ -915,14 +914,13 @@ func (a ClustersAPI) GetOrCreateRunningCluster(name string, custom ...Cluster) (
LocalDisk: true,
})
log.Printf("[INFO] Creating an autoterminating cluster with node type %s", smallestNodeType)
latestVersion, _ := w.Clusters.SelectSparkVersion(a.context, compute.SparkVersionRequest{
Latest: true,
LongTermSupport: true,
})
r := Cluster{
NumWorkers: 1,
ClusterName: name,
SparkVersion: latestVersion,
NumWorkers: 1,
ClusterName: name,
SparkVersion: LatestSparkVersionOrDefault(a.Context(), a.WorkspaceClient(), compute.SparkVersionRequest{
Latest: true,
LongTermSupport: true,
}),
NodeTypeID: smallestNodeType,
AutoterminationMinutes: 10,
}
Expand Down

0 comments on commit dd78ab8

Please sign in to comment.