Skip to content
This repository has been archived by the owner on Jul 19, 2024. It is now read-only.

Commit

Permalink
fix: Missing returns
Browse files Browse the repository at this point in the history
Could've lead to invalid resources in the state
  • Loading branch information
dploeger committed Feb 21, 2023
1 parent dea61c8 commit 2cb9297
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions internal/provider/ldap_object_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)...)
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 2cb9297

Please sign in to comment.