Skip to content

Commit

Permalink
remove the coroot-cluster-agent cluster role if no instances are left
Browse files Browse the repository at this point in the history
  • Loading branch information
apetruhin committed Jan 24, 2025
1 parent 7884502 commit 5fd40d0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ func (r *CorootReconciler) Reconcile(ctx context.Context, req ctrl.Request) (ctr
if r.instances[req] {
logger.Info("Coroot has been deleted")
delete(r.instances, req)
}
if len(r.instances) == 0 {
cr = &corootv1.Coroot{}
cr.Name = req.Name
cr.Namespace = req.Namespace
Expand Down

0 comments on commit 5fd40d0

Please sign in to comment.