From 5c2e9bbe15900d344c420e96e26ef80e71cdc624 Mon Sep 17 00:00:00 2001 From: Jian Zhu Date: Wed, 14 Aug 2024 15:08:43 +0800 Subject: [PATCH] Ignore appliedmanifestwork crd not found error when checking managed cluster connectivity (#594) Signed-off-by: zhujian --- .../klusterletcontroller/klusterlet_cleanup_controller.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_cleanup_controller.go b/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_cleanup_controller.go index 4c85f1412..931bdb062 100644 --- a/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_cleanup_controller.go +++ b/pkg/operator/operators/klusterlet/controllers/klusterletcontroller/klusterlet_cleanup_controller.go @@ -219,6 +219,10 @@ func (n *klusterletCleanupController) checkConnectivity(ctx context.Context, if err == nil { return true, nil } + if errors.IsNotFound(err) { + klog.Infof("AppliedManifestWork not found, klusterlet %s", klusterlet.Name) + return true, nil + } // if the managed cluster is destroyed, the returned err is TCP timeout or TCP no such host, // the k8s.io/apimachinery/pkg/api/errors.IsTimeout,IsServerTimeout can not match this error