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 785409b
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.Name

Check failure on line 50 in bundle/config/resources/clusters.go

View workflow job for this annotation

GitHub Actions / validate-bundle-schema

s.Name undefined (type *Cluster has no field or method Name)

Check failure on line 50 in bundle/config/resources/clusters.go

View workflow job for this annotation

GitHub Actions / tests (macos-latest)

s.Name undefined (type *Cluster has no field or method Name) (compile)

Check failure on line 50 in bundle/config/resources/clusters.go

View workflow job for this annotation

GitHub Actions / tests (ubuntu-latest)

s.Name undefined (type *Cluster has no field or method Name) (compile)

Check failure on line 50 in bundle/config/resources/clusters.go

View workflow job for this annotation

GitHub Actions / tests (windows-latest)

s.Name undefined (type *Cluster has no field or method Name) (compile)
}

func (s *Cluster) GetURL() string {
return s.URL
}

0 comments on commit 785409b

Please sign in to comment.