From 7922964d149be45924824b47471cd55be995f2c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8A=92=E6=83=85=E7=86=8A?= <2669184984@qq.com> Date: Tue, 10 Sep 2024 15:01:06 +0800 Subject: [PATCH 1/3] remove pod finalizer --- .../devbox/internal/controller/devbox_controller.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/controllers/devbox/internal/controller/devbox_controller.go b/controllers/devbox/internal/controller/devbox_controller.go index b4aca506f3c..624f1b9d54c 100644 --- a/controllers/devbox/internal/controller/devbox_controller.go +++ b/controllers/devbox/internal/controller/devbox_controller.go @@ -372,6 +372,16 @@ func commitSuccess(podStatus corev1.PodPhase) bool { func (r *DevboxReconciler) removeAll(ctx context.Context, devbox *devboxv1alpha1.Devbox, recLabels map[string]string) error { // Delete Pod + var podList corev1.PodList + if err := r.List(ctx, &podList, client.InNamespace(devbox.Namespace), client.MatchingLabels(recLabels)); err != nil { + return err + } + for _, pod := range podList.Items { + controllerutil.RemoveFinalizer(&pod, FinalizerName) + if err := r.Update(ctx, &pod); err != nil { + return err + } + } if err := r.deleteResourcesByLabels(ctx, &corev1.Pod{}, devbox.Namespace, recLabels); err != nil { return err } From f1506bfb124c681b327eb5b66781186808b1d75c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8A=92=E6=83=85=E7=86=8A?= <2669184984@qq.com> Date: Tue, 10 Sep 2024 15:17:05 +0800 Subject: [PATCH 2/3] remove pod finalizer --- controllers/devbox/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/devbox/go.mod b/controllers/devbox/go.mod index a2af53dda3a..5b783fee86b 100644 --- a/controllers/devbox/go.mod +++ b/controllers/devbox/go.mod @@ -1,6 +1,6 @@ module github.com/labring/sealos/controllers/devbox -go 1.22.0 +go 1.22 require ( github.com/avast/retry-go v2.7.0+incompatible From 2f9f0f4e1c9299d4d6700863d9e5608de3aef8a2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=8A=92=E6=83=85=E7=86=8A?= <2669184984@qq.com> Date: Tue, 10 Sep 2024 15:21:18 +0800 Subject: [PATCH 3/3] remove pod finalizer --- controllers/devbox/go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/controllers/devbox/go.mod b/controllers/devbox/go.mod index 5b783fee86b..157bca97185 100644 --- a/controllers/devbox/go.mod +++ b/controllers/devbox/go.mod @@ -1,6 +1,6 @@ module github.com/labring/sealos/controllers/devbox -go 1.22 +go 1.23 require ( github.com/avast/retry-go v2.7.0+incompatible