Skip to content

Commit

Permalink
fix clustesr
Browse files Browse the repository at this point in the history
  • Loading branch information
mgyucht committed Jul 11, 2024
1 parent 790bccc commit 79b9a5d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion clusters/data_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ func DataSourceClusters() common.Resource {
return common.WorkspaceData(func(ctx context.Context, data *struct {
Id string `json:"id,omitempty" tf:"computed"`
Ids []string `json:"ids,omitempty" tf:"computed,slice_set"`
ClusterNameContains string `json:"cluster_name_contains"`
ClusterNameContains string `json:"cluster_name_contains,omitempty"`
}, w *databricks.WorkspaceClient) error {
clusters, err := w.Clusters.ListAll(ctx, compute.ListClustersRequest{})
if err != nil {
Expand Down
22 changes: 22 additions & 0 deletions internal/acceptance/data_clusters_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package acceptance

import (
"testing"
)

func TestAccDataSourceClustersNoFilter(t *testing.T) {
workspaceLevel(t, step{
Template: `
data "databricks_clusters" "this" {
} `,
})
}

func TestAccDataSourceClustersWithFilter(t *testing.T) {
workspaceLevel(t, step{
Template: `
data "databricks_clusters" "this" {
cluster_name_contains = "Default"
}`,
})
}

0 comments on commit 79b9a5d

Please sign in to comment.