Skip to content

Commit

Permalink
Fix test failure based on code from main
Browse files Browse the repository at this point in the history
  • Loading branch information
lennartkats-db committed Oct 5, 2024
1 parent 7911c67 commit 65bad56
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
6 changes: 6 additions & 0 deletions bundle/config/resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,12 @@ func (r *Resources) AllResources() map[string]map[string]ConfigResource {
}
result["schemas"] = schemaResources

clusterResources := make(map[string]ConfigResource)
for key, schema := range r.Clusters {
clusterResources[key] = schema
}
result["clusters"] = clusterResources

return result
}

Expand Down
16 changes: 16 additions & 0 deletions bundle/config/resources/clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ type Cluster struct {
ID string `json:"id,omitempty" bundle:"readonly"`
Permissions []Permission `json:"permissions,omitempty"`
ModifiedStatus ModifiedStatus `json:"modified_status,omitempty" bundle:"internal"`
URL string `json:"url,omitempty" bundle:"internal"`

*compute.ClusterSpec
}
Expand All @@ -37,3 +38,18 @@ func (s *Cluster) Exists(ctx context.Context, w *databricks.WorkspaceClient, id
func (s *Cluster) TerraformResourceName() string {
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
}

0 comments on commit 65bad56

Please sign in to comment.