Fix test failure based on code from main

This commit is contained in:
Lennart Kats 2024-10-04 21:03:05 -07:00
parent 7911c672ba
commit 65bad56e10
No known key found for this signature in database
GPG Key ID: 1EB8B57673197023
2 changed files with 22 additions and 0 deletions

View File

@ -92,6 +92,12 @@ func (r *Resources) AllResources() map[string]map[string]ConfigResource {
} }
result["schemas"] = schemaResources result["schemas"] = schemaResources
clusterResources := make(map[string]ConfigResource)
for key, schema := range r.Clusters {
clusterResources[key] = schema
}
result["clusters"] = clusterResources
return result return result
} }

View File

@ -13,6 +13,7 @@ type Cluster struct {
ID string `json:"id,omitempty" bundle:"readonly"` ID string `json:"id,omitempty" bundle:"readonly"`
Permissions []Permission `json:"permissions,omitempty"` Permissions []Permission `json:"permissions,omitempty"`
ModifiedStatus ModifiedStatus `json:"modified_status,omitempty" bundle:"internal"` ModifiedStatus ModifiedStatus `json:"modified_status,omitempty" bundle:"internal"`
URL string `json:"url,omitempty" bundle:"internal"`
*compute.ClusterSpec *compute.ClusterSpec
} }
@ -37,3 +38,18 @@ func (s *Cluster) Exists(ctx context.Context, w *databricks.WorkspaceClient, id
func (s *Cluster) TerraformResourceName() string { func (s *Cluster) TerraformResourceName() string {
return "databricks_cluster" return "databricks_cluster"
} }
func (s *Cluster) InitializeURL(urlPrefix string, urlSuffix string) {
if s.ID == "" {
return
}
s.URL = urlPrefix + "compute/clusters/" + s.ID + urlSuffix
}
func (s *Cluster) GetName() string {
return s.ClusterName
}
func (s *Cluster) GetURL() string {
return s.URL
}