From 30ee4c02573bec7fe297ee5530d787b23355aeea Mon Sep 17 00:00:00 2001 From: Philip Wu Date: Sun, 15 May 2022 23:12:07 -0400 Subject: [PATCH] Ignore package delete error if it is deleted already Signed-off-by: Philip Wu --- pkg/synchronizer/kubernetes/synchronizer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/synchronizer/kubernetes/synchronizer.go b/pkg/synchronizer/kubernetes/synchronizer.go index 63600fc3..9a79c34c 100644 --- a/pkg/synchronizer/kubernetes/synchronizer.go +++ b/pkg/synchronizer/kubernetes/synchronizer.go @@ -105,7 +105,7 @@ func (sync *KubeSynchronizer) DeleteSingleSubscribedResource(hostSub types.Names deletepolicy := metav1.DeletePropagationBackground err = ri.Delete(context.TODO(), pkgObj.GetName(), metav1.DeleteOptions{PropagationPolicy: &deletepolicy}) - if err != nil { + if err != nil && !errors.IsNotFound(err) { klog.Errorf("Failed to delete package, appsub: %v, pkgName: %v, pkgNamespace: %v, err: %v", hostSub, pkgStatus.Name, pkgStatus.Namespace, err)