From 5fd1d49c0b31e5ec36ab0a7d701fa0f3675efe7a Mon Sep 17 00:00:00 2001 From: Tanmay Rustagi Date: Wed, 5 Nov 2025 18:14:26 +0530 Subject: [PATCH 1/2] [Internal] Decouple library schema used in cluster resource with library resource --- NEXT_CHANGELOG.md | 1 + clusters/resource_cluster.go | 2 +- clusters/resource_library.go | 17 +++++++++++++++++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index b3759f2636..ed0d89b889 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -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 ([]()). diff --git a/clusters/resource_cluster.go b/clusters/resource_cluster.go index e7107f9e5b..773949fa3e 100644 --- a/clusters/resource_cluster.go +++ b/clusters/resource_cluster.go @@ -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{}) } diff --git a/clusters/resource_library.go b/clusters/resource_library.go index e7b948a5c5..ab7f7e8400 100644 --- a/clusters/resource_library.go +++ b/clusters/resource_library.go @@ -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 From e1847c2ad43f2b436d19d350d89b7573df307c74 Mon Sep 17 00:00:00 2001 From: Tanmay Rustagi Date: Wed, 5 Nov 2025 18:17:38 +0530 Subject: [PATCH 2/2] - --- NEXT_CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/NEXT_CHANGELOG.md b/NEXT_CHANGELOG.md index ed0d89b889..6cc3e0fbce 100644 --- a/NEXT_CHANGELOG.md +++ b/NEXT_CHANGELOG.md @@ -17,4 +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 ([]()). +* Decouple library schema used in cluster resource with library resource ([#5189](https://github.com/databricks/terraform-provider-databricks/pull/5189)).