Skip to content

Commit

Permalink
fix: just reconcile active AccessRequests on AppProject or RoleTempla…
Browse files Browse the repository at this point in the history
…te change

Signed-off-by: Leonardo Luz Almeida <[email protected]>
  • Loading branch information
leoluz committed Oct 30, 2024
1 parent 00e02a8 commit 98816b9
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions internal/controller/accessrequest_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -365,15 +365,15 @@ func (r *AccessRequestReconciler) callReconcileForRoleTemplate(ctx context.Conte
return []reconcile.Request{}
}

requests := make([]reconcile.Request, len(attachedAccessRequests.Items))
for i, item := range attachedAccessRequests.Items {
requests := []reconcile.Request{}
for _, item := range attachedAccessRequests.Items {
if !isConcluded(&item) {
requests[i] = reconcile.Request{
requests = append(requests, reconcile.Request{
NamespacedName: types.NamespacedName{
Name: item.GetName(),
Namespace: item.GetNamespace(),
},
}
})
}
}
totalRequests := len(requests)
Expand Down Expand Up @@ -427,15 +427,15 @@ func (r *AccessRequestReconciler) callReconcileForProject(ctx context.Context, p
return []reconcile.Request{}
}

requests := make([]reconcile.Request, len(associatedAccessRequests.Items))
for i, item := range associatedAccessRequests.Items {
requests := []reconcile.Request{}
for _, item := range associatedAccessRequests.Items {
if !isConcluded(&item) {
requests[i] = reconcile.Request{
requests = append(requests, reconcile.Request{
NamespacedName: types.NamespacedName{
Name: item.GetName(),
Namespace: item.GetNamespace(),
},
}
})
}
}
totalRequests := len(requests)
Expand Down

0 comments on commit 98816b9

Please sign in to comment.