-
Notifications
You must be signed in to change notification settings - Fork 40k
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 output to give user awareness of how long timeouts are expected to be #65164
Add output to give user awareness of how long timeouts are expected to be #65164
Conversation
/assign @detiber |
/assign @neolit123 |
ref #64988 |
6900f45
to
fda81d7
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.
thanks for having a look a this @xlgao-zju !
i've added a couple of comments.
please, also rename the commit title to be shorter in the lines of:
kubeadm-upgrade: notify the user of manifest upgrade timeouts
if you want to add more information add it in the commit message body.
cmd/kubeadm/app/cmd/upgrade/apply.go
Outdated
@@ -194,6 +194,7 @@ func RunApply(flags *applyFlags) error { | |||
// Use a prepuller implementation based on creating DaemonSets | |||
// and block until all DaemonSets are ready; then we know for sure that all control plane images are cached locally | |||
glog.V(1).Infof("[upgrade/apply] creating prepuller") | |||
upgrade.UpgradeManifestTimeout = upgradeManifestTimeout |
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.
cmd/upgrade
imports phases/upgrade
as a backend.
instead of modifying a package global variable in upgrade
, why not move the constant to the upgrade
package?
also make sure you add a comment on top of global variables / constants.
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.
@neolit123 Since I tried to modify the origin code as less as I could... But this thought seems wrong... 😅
@@ -228,6 +231,7 @@ func upgradeComponent(component string, waiter apiclient.Waiter, pathMgr StaticP | |||
|
|||
if waitForComponentRestart { | |||
fmt.Println("[upgrade/staticpods] Waiting for the kubelet to restart the component") | |||
fmt.Println("[upgrade/staticpods] This operation will timeout in ", UpgradeManifestTimeout) |
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.
we should use Printf()
:
fmt.Printf("[upgrade/staticpods] This operation will timeout in %v\n", UpgradeManifestTimeout)
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.
ok, but this will print the same thing as what I added...
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, definitely!
the kubeadm codebase uses Printf()
in all places where an argument is printed and Println()
if no arguments are printed.
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.
Got you!
So kind you are. Thank you for your help!
@xlgao-zju you can modify it in the first message in this PR (under |
fda81d7
to
69be0c9
Compare
Added |
thanks @xlgao-zju ! |
@@ -228,6 +233,7 @@ func upgradeComponent(component string, waiter apiclient.Waiter, pathMgr StaticP | |||
|
|||
if waitForComponentRestart { | |||
fmt.Println("[upgrade/staticpods] Waiting for the kubelet to restart the component") | |||
fmt.Printf("[upgrade/staticpods] This operation will timeout in %v\n", UpgradeManifestTimeout) |
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.
why not just alter message above to add timeout value ?
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.
@kad updated
69be0c9
to
4b8b73f
Compare
@kad updated |
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.
@xlgao-zju This looks great, thanks. I would like to keep the original linked issue open, since there are still other timeouts that we do not provide user output for as well, though.
@detiber Yes, I think we can merge this PR. And then we should figure out where we should add the output. Before we call the function in |
@xlgao-zju yes, adding some type of output in /lgtm |
@detiber Yes, we can add a TODO list in the original issue to track all the output we should add. @timothysc need your approve... |
Should we place |
@rosti |
@neolit123 +1 for |
/assign @fabriziopandini |
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.
@xlgao-zju thanks for this PR!
I'm fine why your proposal, with a simple request of improvement on the message for bettet consistency with the overall kubeadm UX.
@neolit123 @detiber feel free to improve the message
@fabriziopandini Hi, I am not quiet understand your requirement... Cloud you make it more clearer, os I can improve this PR. Or cloud you explain the |
@neolit123 Cloud you take another look at this? How could I improve this PR? |
@fabriziopandini can you please elaborate on how to improve the message? :) |
@@ -227,7 +232,7 @@ func upgradeComponent(component string, waiter apiclient.Waiter, pathMgr StaticP | |||
fmt.Printf("[upgrade/staticpods] Moved new manifest to %q and backed up old manifest to %q\n", currentManifestPath, backupManifestPath) | |||
|
|||
if waitForComponentRestart { | |||
fmt.Println("[upgrade/staticpods] Waiting for the kubelet to restart the component") | |||
fmt.Printf("[upgrade/staticpods] Waiting for the kubelet to restart the component. This operation will timeout in %v\n", UpgradeManifestTimeout) | |||
|
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.
@xlgao-zju sorry I forgot to clck add comment 😶
Please make this more consistent with other kubeadm Wait messages e.g.
fmt.Printf("[upgrade/staticpods] Waiting for the kubelet to restart the component")
fmt.Printf("[upgrade/staticpods] This might take a minute or longer depending on the component/version gap (timeout %v\n", UpgradeManifestTimeout)
This includes a short reassuring description about what Kubeadm is doing and why the user should wait (in this case I suggest a generic note)
4b8b73f
to
ad5abab
Compare
Signed-off-by: Xianglin Gao <xianglin.gxl@alibaba-inc.com>
ad5abab
to
b309ace
Compare
@fabriziopandini updated. @neolit123 @detiber As I said, we can add a |
/lgtm |
@fabriziopandini need your approve |
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: detiber, timothysc, xlgao-zju 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 |
Automatic merge from submit-queue (batch tested with PRs 65164, 65258). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
Add output to give user awareness of how long manifest upgrade timeout is expected to be.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):ref kubernetes/kubeadm/#914
Special notes for your reviewer:
Release note: