From 9f4c8761eb711598205b73c17d34b109e2fe9580 Mon Sep 17 00:00:00 2001 From: Lachezar Tsonov Date: Thu, 14 Nov 2024 11:29:44 +0200 Subject: [PATCH] Handle err from Set --- castai/resource_aks_cluster.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/castai/resource_aks_cluster.go b/castai/resource_aks_cluster.go index 0bf661ac..6be929d1 100644 --- a/castai/resource_aks_cluster.go +++ b/castai/resource_aks_cluster.go @@ -276,6 +276,9 @@ func updateAKSClusterSettings(ctx context.Context, data *schema.ResourceData, cl // In case the update succeeded, we must update the state with the *generated* credentials_id before re-reading. // This is because on update, the credentials_id always changes => read drift detection would see that and trigger infinite drift err = data.Set(FieldClusterCredentialsId, credentialsID) + if err != nil { + return fmt.Errorf("failed to update credentials ID after successful update: %w", err) + } return nil }