-
Notifications
You must be signed in to change notification settings - Fork 40.1k
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
Improve human-readable output of Deployments and StatefulSets #70466
Conversation
/ok-to-test |
/assign @janetkuo |
@Pingan2017 thanks for addressing this. While you're in this part of the codebase, would you mind updating the overall output to be consistent with what is detailed in #68623 ? Also, would be great if you'd like to address this for Deployments as well. Thanks |
kubectl get sts
commandkubectl get sts
command
11cbafa
to
aeb86d2
Compare
kubectl get sts
command
@juanvallejo PTAL, Thanks! |
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.
few nits, otherwise lgtm
@@ -1042,9 +1040,9 @@ func printStatefulSet(obj *apps.StatefulSet, options printers.PrintOptions) ([]m | |||
Object: runtime.RawExtension{Object: obj}, | |||
} | |||
desiredReplicas := obj.Spec.Replicas | |||
currentReplicas := obj.Status.Replicas | |||
readyReplicas := obj.Status.ReadyReplicas |
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.
Since the idea is to merge current/desired
to ready
, I don't think this renaming is worthy.
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.
Sorry, but could you explain why to choose obj.Status.ReadyReplicas
instead of obj.Status.Replicas
here?
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 will make ambiguous sometimes for users.
sometimes , the pod is not Ready, but the current and desired is equal. the Ready (1/1) will make users think the deployment is available.
[root@hpa-vm:/etc/kubernetes]$ kubectl get deploy
NAME READY UP-TO-DATE AVAILABLE AGE
nginx-deployment 1/1 1 0 45m
OR we can using CURRENT instead of READY?
I dont think Ready
is a good idea to show current/desired
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, that's making sense now. I'll defer the choice to @kubernetes/sig-cli-feature-requests
updatedReplicas := obj.Status.UpdatedReplicas | ||
readyReplicas := obj.Status.ReadyReplicas |
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.
same here ^
And you need to update tests too |
3de0db6
to
77b0ddc
Compare
/test pull-kubernetes-e2e-kops-aws |
/lgtm cc @soltysh for approval |
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
A few nits that I'd like to see addressed:
/lgtm cancel
and also please update release notes, your change is a user facing one, so you need to have on.
@@ -203,8 +203,7 @@ func AddHandlers(h printers.PrintHandler) { | |||
|
|||
statefulSetColumnDefinitions := []metav1beta1.TableColumnDefinition{ | |||
{Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, | |||
{Name: "Desired", Type: "string", Description: appsv1beta1.StatefulSetSpec{}.SwaggerDoc()["replicas"]}, | |||
{Name: "Current", Type: "string", Description: appsv1beta1.StatefulSetStatus{}.SwaggerDoc()["replicas"]}, | |||
{Name: "Ready", Type: "string", Description: "the number of the pod with ready state"}, |
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.
s/the number/Number
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! fix it.
@@ -313,8 +312,7 @@ func AddHandlers(h printers.PrintHandler) { | |||
|
|||
deploymentColumnDefinitions := []metav1beta1.TableColumnDefinition{ | |||
{Name: "Name", Type: "string", Format: "name", Description: metav1.ObjectMeta{}.SwaggerDoc()["name"]}, | |||
{Name: "Desired", Type: "string", Description: extensionsv1beta1.DeploymentSpec{}.SwaggerDoc()["replicas"]}, | |||
{Name: "Current", Type: "string", Description: extensionsv1beta1.DeploymentStatus{}.SwaggerDoc()["replicas"]}, | |||
{Name: "Ready", Type: "string", Description: "the number of the pod with ready state"}, |
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.
s/the number/Number
/milestone v1.13 |
77b0ddc
to
182a66f
Compare
@soltysh Updated. PTAL, Thanks! |
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: Pingan2017, soltysh 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
/sig cli
What this PR does / why we need it:
add
Ready
column forkubectl get sts
commandWhich issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Special notes for your reviewer:
/cc @soltysh
Does this PR introduce a user-facing change?: