-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
🐛 Ignore appliedmanifestwork crd not found error when checking managed cluster connectivity #594
🐛 Ignore appliedmanifestwork crd not found error when checking managed cluster connectivity #594
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zhujian7 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #594 +/- ##
==========================================
- Coverage 63.74% 63.73% -0.02%
==========================================
Files 181 181
Lines 14039 14042 +3
==========================================
Hits 8949 8949
- Misses 4195 4198 +3
Partials 895 895
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
/cc @elgnay @qiujian16 |
@@ -220,6 +220,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, ignore the resources", klusterlet.Name) | |||
return false, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Return true
or false
in this situation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
returning true means we need to clean up resources on the managed cluster(appliedmanifestworks, namespaces,crds), here if the appliedmanifestwork CRD is not found, I think we do not need to do the cleanup on the managed cluster.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
discussed with Le offline, As the func checkConnectivity's name suggests, not found means the connectivity is OK, so I changed to returning true here.
…cluster connectivity Signed-off-by: zhujian <jiazhu@redhat.com>
dc9cf5a
to
dcfdb61
Compare
/lgtm |
3d8cb1e
into
open-cluster-management-io:main
…cluster connectivity (open-cluster-management-io#594) Signed-off-by: zhujian <jiazhu@redhat.com>
…cluster connectivity (open-cluster-management-io#594) Signed-off-by: zhujian <jiazhu@redhat.com>
…cluster connectivity (open-cluster-management-io#594) Signed-off-by: zhujian <jiazhu@redhat.com>
…cluster connectivity (open-cluster-management-io#594) (#116) Signed-off-by: zhujian <jiazhu@redhat.com>
…cluster connectivity (open-cluster-management-io#594) Signed-off-by: zhujian <jiazhu@redhat.com>
…cluster connectivity (open-cluster-management-io#594) Signed-off-by: zhujian <jiazhu@redhat.com>
…cluster connectivity (open-cluster-management-io#594) (#120) Signed-off-by: zhujian <jiazhu@redhat.com> Co-authored-by: Jian Zhu <jiazhu@redhat.com>
…cluster connectivity (open-cluster-management-io#594) (#119) Signed-off-by: zhujian <jiazhu@redhat.com> Co-authored-by: Jian Zhu <jiazhu@redhat.com>
Summary
This PR will fix the bug that detaching cluster gets stuck when appliedManifestWork CRD does not exist on the hosted managed cluster
Related issue(s)
Fixes #