-
Notifications
You must be signed in to change notification settings - Fork 39.6k
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
Dereference number of replicas in describe statefulset #72781
Dereference number of replicas in describe statefulset #72781
Conversation
Hi @tghartland. Thanks for your PR. I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
/sig cli |
/assign @apelisse |
Surprising how bugs like this can stay unnoticed :-). I guess it's hard to test since this is mostly for human consumption, and people mostly don't look at replicaset? Thanks! |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: apelisse, tghartland 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 |
/ok-to-test |
/retest |
@@ -2959,7 +2959,7 @@ func describeStatefulSet(ps *appsv1.StatefulSet, selector labels.Selector, event | |||
w.Write(LEVEL_0, "Selector:\t%s\n", selector) | |||
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, "Replicas:\t%d desired | %d total\n", *ps.Spec.Replicas, ps.Status.Replicas) |
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 happens if this is nil?
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.
Good point ...
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 StatefulSetSpec says that Replicas defaults to 1 if unspecified. I assume this means that it is never nil.
kubernetes/staging/src/k8s.io/api/apps/v1beta1/types.go
Lines 155 to 161 in dad6741
// replicas is the desired number of replicas of the given Template. | |
// These are replicas in the sense that they are instantiations of the | |
// same Template, but individual replicas also have a consistent identity. | |
// If unspecified, defaults to 1. | |
// TODO: Consider a rename of this field. | |
// +optional | |
Replicas *int32 `json:"replicas,omitempty" protobuf:"varint,1,opt,name=replicas"` |
/retest Review the full test history for this PR. Silence the bot with an |
1 similar comment
/retest Review the full test history for this PR. Silence the bot with an |
What type of PR is this?
/kind bug
What this PR does / why we need it:
describe statefulset
currently prints useless memory address instead of the value of the number of desired replicas.Which issue(s) this PR fixes:
Fixes #72780
Special notes for your reviewer:
Does this PR introduce a user-facing change?: