From 2034f28deba843c8eb75f2a1306a725ceb606cb1 Mon Sep 17 00:00:00 2001 From: Tanmay Rustagi Date: Mon, 5 Jun 2023 19:06:20 +0200 Subject: [PATCH 1/2] update only if no error is retured --- catalog/resource_volume.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/catalog/resource_volume.go b/catalog/resource_volume.go index e0893571dc..6ddd3be39e 100644 --- a/catalog/resource_volume.go +++ b/catalog/resource_volume.go @@ -82,12 +82,12 @@ func ResourceVolume() *schema.Resource { common.DataToStructPointer(d, s, &updateVolumeRequestContent) updateVolumeRequestContent.FullNameArg = d.Id() v, err := w.Volumes.Update(ctx, updateVolumeRequestContent) - // We need to update the resource data because Name is updatable and FullName consists of Name, - // So if we don't update the field then the requests would be made to old FullName which doesn't exists. - d.SetId(v.FullName) if err != nil { return err } + // We need to update the resource data because Name is updatable and FullName consists of Name, + // So if we don't update the field then the requests would be made to old FullName which doesn't exists. + d.SetId(v.FullName) return nil }, Delete: func(ctx context.Context, d *schema.ResourceData, c *common.DatabricksClient) error { From 8cf46a14d712ed8a160e4cebad6811f6fbe23eb1 Mon Sep 17 00:00:00 2001 From: Tanmay Rustagi Date: Tue, 6 Jun 2023 14:17:30 +0200 Subject: [PATCH 2/2] upd comment --- catalog/resource_volume.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/catalog/resource_volume.go b/catalog/resource_volume.go index 6ddd3be39e..c84b829adc 100644 --- a/catalog/resource_volume.go +++ b/catalog/resource_volume.go @@ -85,7 +85,7 @@ func ResourceVolume() *schema.Resource { if err != nil { return err } - // We need to update the resource data because Name is updatable and FullName consists of Name, + // We need to update the resource Id because Name is updatable and FullName consists of Name, // So if we don't update the field then the requests would be made to old FullName which doesn't exists. d.SetId(v.FullName) return nil