Skip to content

Commit

Permalink
Handle err from Set
Browse files Browse the repository at this point in the history
  • Loading branch information
Tsonov committed Nov 14, 2024
1 parent 0340737 commit 9f4c876
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions castai/resource_aks_cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

0 comments on commit 9f4c876

Please sign in to comment.