Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions NEXT_CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@
* Initial support for resources implemented with plugin framework ([#5176](https://github.com/databricks/terraform-provider-databricks/pull/5176)).

### Internal Changes
* Decouple library schema used in cluster resource with library resource ([#5189](https://github.com/databricks/terraform-provider-databricks/pull/5189)).
2 changes: 1 addition & 1 deletion clusters/resource_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -722,5 +722,5 @@ func resourceClusterDelete(ctx context.Context, d *schema.ResourceData, c *commo

func init() {
common.RegisterResourceProvider(compute.ClusterSpec{}, ClusterSpec{})
common.RegisterResourceProvider(compute.Library{}, LibraryResource{})
common.RegisterResourceProvider(compute.Library{}, LibraryResourceWithoutNamespace{})
}
17 changes: 17 additions & 0 deletions clusters/resource_library.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,23 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
)

type LibraryResourceWithoutNamespace struct {
compute.Library
}

func (LibraryResourceWithoutNamespace) CustomizeSchemaResourceSpecific(s *common.CustomizableSchema) *common.CustomizableSchema {
s.AddNewField("cluster_id", &schema.Schema{
Type: schema.TypeString,
Required: true,
})
return s
}

func (LibraryResourceWithoutNamespace) CustomizeSchema(s *common.CustomizableSchema) *common.CustomizableSchema {
s.SchemaPath("egg").SetDeprecated(EggDeprecationWarning)
return s
}

type LibraryResource struct {
compute.Library
common.Namespace
Expand Down
Loading