Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: just reconcile active AccessRequests on AppProject or RoleTemplate change #52

Merged
merged 1 commit into from
Oct 31, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading