Fix: skipGC remove labels for multi-cluster resource not use correct ctx (#4622)

Signed-off-by: Somefive <yd219913@alibaba-inc.com>
(cherry picked from commit c59755b6a4)

Co-authored-by: Somefive <yd219913@alibaba-inc.com>
This commit is contained in:
github-actions[bot]
2022-08-15 11:09:32 +08:00
committed by GitHub
co-authored by Somefive
parent 3df1776b37
commit 3177d26fc4
+1 -1
View File
@@ -352,7 +352,7 @@ func (h *gcHandler) deleteManagedResource(ctx context.Context, mr v1beta1.Manage
delete(labels, oam.LabelAppNamespace)
entry.obj.SetLabels(labels)
}
return errors.Wrapf(h.Client.Update(ctx, entry.obj), "failed to remove owner labels for resource while skipping gc")
return errors.Wrapf(h.Client.Update(_ctx, entry.obj), "failed to remove owner labels for resource while skipping gc")
}
if err := h.Client.Delete(_ctx, entry.obj); err != nil && !kerrors.IsNotFound(err) {
return errors.Wrapf(err, "failed to delete resource %s", mr.ResourceKey())