-
Notifications
You must be signed in to change notification settings - Fork 921
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
WaitAPIServiceReady use watch #3415
base: master
Are you sure you want to change the base?
WaitAPIServiceReady use watch #3415
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report
📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more @@ Coverage Diff @@
## master #3415 +/- ##
==========================================
- Coverage 51.79% 51.75% -0.05%
==========================================
Files 210 210
Lines 18926 18938 +12
==========================================
- Hits 9803 9801 -2
- Misses 8581 8595 +14
Partials 542 542
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 1 file with indirect coverage changes Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
978486b
to
153aeec
Compare
/retest |
40143d5
to
9b523b0
Compare
Signed-off-by: helen <[email protected]>
9b523b0
to
ae1f3d8
Compare
How many logs |
The new cluster installed karmada, and measured the init before and after the change, the measured log volume dropped from 77 to 18 |
What kind of log is avoided? |
The original code will print this log every 1s. I0418 06:33:32.788899 375506 check.go:26] Waiting for APIService(v1alpha1.cluster.karmada.io) condition(Available), will try |
@RainbowMango @lonelyCZ hi, After troubleshooting errors for #3418, I think it is necessary to reduce the useless duplicate logs of WaitAPIServiceReady and request merge. |
Do you mean #3418 rely on this PR? |
apiService, err := c.ApiregistrationV1().APIServices().Get(context.TODO(), name, metav1.GetOptions{}) | ||
if err != nil { | ||
return err | ||
} |
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.
What if the APIService not exist at that time?
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 when this situation occurs, the normal error can be thrown, WaitAPIServiceReady premise is that there is already APIService
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.
Please @lonelyCZ check if the behavior change is acceptable.
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.
Before executing WaitAPIServiceReady
, we firstly CreateOrUpdateAPIService
in general.
karmada/pkg/karmadactl/cmdinit/karmada/deploy.go
Lines 302 to 308 in 3604123
if err = util.CreateOrUpdateAPIService(apiRegistrationClient, aaAPIService); err != nil { | |
return err | |
} | |
if err := WaitAPIServiceReady(apiRegistrationClient, aaAPIServiceObjName, 120*time.Second); err != nil { | |
return err | |
} |
Not interdependent, just found useful when troubleshooting errors and reducing duplicate error logs |
} | ||
|
||
if apiregistrationv1helper.IsAPIServiceConditionTrue(updatedAPIService, apiregistrationv1.Available) { | ||
return nil | ||
} | ||
|
||
klog.Infof("Waiting for APIService(%s) condition(%s), will try", name, apiregistrationv1.Available) |
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.
Here will dump info
logs, does it seems too verbose?
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.
The length looks ok, for example I0601 05:59:14.497568 20024 check.go:26] Waiting for APIService(v1alpha1.cluster.karmada.io) condition(Available), will try
Maybe we shouldn't print this log, it just tells the user that karmadactl is executing and the current shell is not disconnected, so it's not really that useful
PS: I prefer to use kwokctl circle waiting method, but this seems to be a bit of a big change, I don't know what you think about the evolution of karmadactl later
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.
Maybe we shouldn't print this log, it just tells the user that karmadactl is executing and the current shell is not disconnected, so it's not really that useful
Yes, I think that is one of the benefits that keep telling users that karmadactl
isn't hanging there. :)
PS: I prefer to use kwokctl circle waiting method, but this seems to be a bit of a big change, I don't know what you think about the evolution of karmadactl later
Don't know about kwokctl circle.
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.
The kworkctl circle
is cool, many project CLI use this way, like subctl of submariner that are interesting and clear. I think we also use this way in the future.
/cc @lonelyCZ |
Thanks @helen-frank , I will look it ASAP /assign |
Hi, @helen-frank , Could you paste your test result, how many logs do we reduce? |
The log volume was reduced from 77 to 18 when karmada-aggregated-apiserver failed to start properly |
ping @lonelyCZ |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Avoid too many logs
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: