-
Notifications
You must be signed in to change notification settings - Fork 891
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
skip interpret health of resources without a hook #5530
Conversation
Codecov ReportAttention: Patch coverage is
❗ Your organization needs to install the Codecov GitHub app to enable full functionality. Additional details and impacted files@@ Coverage Diff @@
## master #5530 +/- ##
==========================================
+ Coverage 35.21% 35.22% +0.01%
==========================================
Files 645 645
Lines 44885 44891 +6
==========================================
+ Hits 15806 15814 +8
+ Misses 27847 27842 -5
- Partials 1232 1235 +3
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
@a7i if !c.ResourceInterpreter.HookEnabled(resourceKey.GroupVersionKind(), configv1alpha1.InterpreterOperationInterpretHealth) {
// skip interpreting health ....
} |
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.
I think it's reasonable.
LGTM
Sorry, I don't understand. The current modification does not skip the health parsing step, but directly considers health as true when the object does not have status. |
it's fake health. we should avoid modifying the default interpreter if there are no new features or bug fixes, and we should have called |
in addition, it seems that we have no regulations that do not interpret the health of resources without status. maybe there will be such resources in the future. |
That's the point. So logically, this pr modification is correct, but there is an alternative, which is to call the HookEnabled method, which I think is OK. How do you think @a7i ? |
I agree with what @whitewindmills said, it is quite right. What problem #4453 resolved is,
updated: I made a mistake, |
Thanks @a7i for bringing this up, and thanks to @whitewindmills for the reminder that we have revisited the The agreement we made at that time was: Speaking of the improvements, I agree with @whitewindmills that we should skip evaluating those resources that don't implement |
c8f45f0
to
8e50532
Compare
Thanks for the feedback. Pushed up a commit, let me know what you think! |
8e50532
to
ba77642
Compare
} else if healthy { | ||
resourceHealth = workv1alpha1.ResourceHealthy | ||
c.EventRecorder.Eventf(work, corev1.EventTypeNormal, events.EventReasonInterpretHealthSucceed, "Interpret health of object(%s/%s/%s) as healthy.", clusterObj.GetKind(), clusterObj.GetNamespace(), clusterObj.GetName()) |
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.
One question, do we still need to report the event in the skip 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.
Good question, open to feedback. I personally would prefer if we didn't record the event
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.
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.
No evidence shows we need it yet, we can skip the event for this PR.
Hi all, any feedback? |
lgtm |
LGTM |
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.
/assign
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.
Generally looks good to me!
I like the idea that have a dedicated methods for healthy assessment very much! Thank you!
} else if healthy { | ||
resourceHealth = workv1alpha1.ResourceHealthy | ||
c.EventRecorder.Eventf(work, corev1.EventTypeNormal, events.EventReasonInterpretHealthSucceed, "Interpret health of object(%s/%s/%s) as healthy.", clusterObj.GetKind(), clusterObj.GetNamespace(), clusterObj.GetName()) |
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.
No evidence shows we need it yet, we can skip the event for this PR.
Signed-off-by: Amir Alavi <amiralavi7@gmail.com>
ba77642
to
dbed854
Compare
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.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: RainbowMango 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
In one of our small staging clusters, we get a lot of InterpretHealthFailed events (over 100k per week). After investigations, it seems to be resources such as ClusterRole and ClusterRoleBinding that never have a status, so there is nothing to inspect.
This is also repeated over and over again in karmada-controller-manager logs:
**Which issue(s)
is PR fixes**:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: