-
Notifications
You must be signed in to change notification settings - Fork 39.2k
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 strategy description for 'kubectl describe sts' command #63844
Add strategy description for 'kubectl describe sts' command #63844
Conversation
/assign @janetkuo |
/ok-to-test |
@@ -2764,6 +2764,12 @@ func describeStatefulSet(ps *apps.StatefulSet, selector labels.Selector, events | |||
printLabelsMultiline(w, "Labels", ps.Labels) | |||
printAnnotationsMultiline(w, "Annotations", ps.Annotations) | |||
w.Write(LEVEL_0, "Replicas:\t%d desired | %d total\n", ps.Spec.Replicas, ps.Status.Replicas) | |||
w.Write(LEVEL_0, "UpdateStrategyType:\t%s\n", ps.Spec.UpdateStrategy.Type) | |||
if ps.Spec.UpdateStrategy.RollingUpdate != nil { | |||
ru := ps.Spec.UpdateStrategy.RollingUpdate |
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.
nit: move this line to before if
so that you can do if ru != nil
@@ -2764,6 +2764,12 @@ func describeStatefulSet(ps *apps.StatefulSet, selector labels.Selector, events | |||
printLabelsMultiline(w, "Labels", ps.Labels) | |||
printAnnotationsMultiline(w, "Annotations", ps.Annotations) | |||
w.Write(LEVEL_0, "Replicas:\t%d desired | %d total\n", ps.Spec.Replicas, ps.Status.Replicas) | |||
w.Write(LEVEL_0, "UpdateStrategyType:\t%s\n", ps.Spec.UpdateStrategy.Type) |
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.
"Update Strategy:"
w.Write(LEVEL_0, "UpdateStrategyType:\t%s\n", ps.Spec.UpdateStrategy.Type) | ||
if ps.Spec.UpdateStrategy.RollingUpdate != nil { | ||
ru := ps.Spec.UpdateStrategy.RollingUpdate | ||
w.Write(LEVEL_0, "RollingUpdateStrategy:\t%d partition\n", ru.Partition) |
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.
This can be LEVEL_1
, "Partition:"
.
Suggest not printing partition when the value is 0 (no partition).
cc @kow3ns |
fef0f41
to
2fd7313
Compare
@janetkuo updated, PTAL! |
/cc @kow3ns |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: janetkuo, tossmilestone 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 63871, 63927, 63966, 63957, 63844). If you want to cherry-pick this change to another branch, please follow the instructions here. |
What this PR does / why we need it:
To display
UpdateStrategyType
andRollingUpdateStrategy
information when executekubectl describe sts
command, the output likes:Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes None
Special notes for your reviewer:
Release note: