Skip to content

Commit

Permalink
Do not release pods in terminating namespaces.
Browse files Browse the repository at this point in the history
When a namespace is in the 'Terminating' phase,
it means that Kubernetes is in the process
of removing all resources from that namespace.

We should not attempt to release pods in
such namespaces.

Signed-off-by: bmordeha <[email protected]>
  • Loading branch information
Barakmor1 authored and kubevirt-bot committed May 7, 2024
1 parent dc154e2 commit be49b42
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/aaq-controller/aaq-gate-controller/aaq-gate-controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,11 @@ func (ctrl *AaqGateController) Execute() bool {
}

func (ctrl *AaqGateController) execute(ns string) (error, enqueueState) {
_, err := ctrl.namespaceLister.Get(ns)
if kapierrors.IsNotFound(err) {
namespace, err := ctrl.namespaceLister.Get(ns)
if kapierrors.IsNotFound(err) || namespace.Status.Phase == v1.NamespaceTerminating {
return nil, Forget
}

aaqjqc, err := ctrl.createAndGetAaqjqc(ns)
if err != nil {
return err, Immediate
Expand Down

0 comments on commit be49b42

Please sign in to comment.