-
Notifications
You must be signed in to change notification settings - Fork 48
✨ add new addonHealthCheck func to check all fields and support wildcard #289
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
✨ add new addonHealthCheck func to check all fields and support wildcard #289
Conversation
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zhiweiyin318 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 |
2859b36 to
f890394
Compare
|
/assign @qiujian16 |
f890394 to
754aecc
Compare
|
/lgtm |
healthChecker was introduced in open-cluster-management-io/addon-framework#289 and it allow us to define a list of ProbeFields as before but it also allows us to define HealthChecker. HealthChecker has the ability to go through all the resultFields and decide which resources are mandatory and should trigger unheathly probes and which resources are optional
healthChecker was introduced in open-cluster-management-io/addon-framework#289 and it allow us to define a list of ProbeFields as before but it also allows us to define HealthChecker. HealthChecker has the ability to go through all the resultFields and decide which resources are mandatory and should trigger unheathly probes and which resources are optional
healthChecker was introduced in open-cluster-management-io/addon-framework#289 and it allow us to define a list of ProbeFields as before but it also allows us to define HealthChecker. HealthChecker has the ability to go through all the resultFields and decide which resources are mandatory and should trigger unheathly probes and which resources are optional
pkg/agent/inteface.go
Outdated
| } | ||
|
|
||
| type AddonHealthCheckFunc func(workapiv1.ResourceIdentifier, workapiv1.StatusFeedbackResult) error | ||
| type AddonHealthCheckerFunc func([]ResultField) error |
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.
Is the managedclusteraddon or managedcluster also required in some cases?
I remember someone raised a similar demand during our offline discussion?
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.
@qiujian16 looks like it makes sense to input cluster and mca. WDYT?
| } | ||
|
|
||
| probeFields, healthChecker, err := s.analyzeWorkProber(s.agentAddon, cluster, addon) | ||
| probeFields, healthChecker, healthAllChecker, err := s.analyzeWorkProber(s.agentAddon, cluster, addon) |
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 don't think healthAllChecker is a proper name here. seems no meaning for All?
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.
re-named
|
|
||
| var resultFields []agent.ResultField | ||
|
|
||
| for _, field := range probeFields { |
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.
can we separate the healthChecker(Deprecated one) and healthAllChecker logic into two different functions, so it is clear and easy to deprecate in the future?
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.
Add a TODO here, will follow up to refactor this part
|
|
||
| return &status.StatusFeedbacks | ||
| // compare two string, target may include * | ||
| func wildcardMatch(resource, target string) bool { |
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.
These seem to be duplicates of the ocm/work code?
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.
yes. only this two parts use it
754aecc to
822a2cc
Compare
Signed-off-by: Zhiwei Yin <[email protected]>
822a2cc to
8beaf27
Compare
|
/lgtm |
|
/unhold |
81a5903
into
open-cluster-management-io:main
Summary
Related issue(s)
#288
#287
Fixes #