From 2cb9297bb266fb6f9193824a95b7dbd6a98e48ea Mon Sep 17 00:00:00 2001 From: Dennis Ploeger Date: Tue, 21 Feb 2023 22:12:20 +0100 Subject: [PATCH] fix: Missing returns Could've lead to invalid resources in the state --- internal/provider/ldap_object_resource.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/internal/provider/ldap_object_resource.go b/internal/provider/ldap_object_resource.go index a5dd683..35c04ec 100644 --- a/internal/provider/ldap_object_resource.go +++ b/internal/provider/ldap_object_resource.go @@ -103,6 +103,7 @@ func (L *LDAPObjectResource) Create(ctx context.Context, request resource.Create "Can not add resource", fmt.Sprintf("LDAP server reported: %s", err), ) + return } data.ID = data.DN response.Diagnostics.Append(response.State.Set(ctx, &data)...) @@ -156,6 +157,7 @@ func (L *LDAPObjectResource) Update(ctx context.Context, request resource.Update "Can not add resource", fmt.Sprintf("LDAP server reported: %s", err), ) + return } } else { var stateAttributes map[string][]string @@ -199,6 +201,7 @@ func (L *LDAPObjectResource) Update(ctx context.Context, request resource.Update "Can not modify entry", fmt.Sprintf("LDAP server reported: %s", err), ) + return } } planData.ID = planData.DN