Skip to content
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

kubectl did not print readable message of statefulset PVC's capacity. #47571

Closed
k82cn opened this issue Jun 15, 2017 · 11 comments · Fixed by #47573
Closed

kubectl did not print readable message of statefulset PVC's capacity. #47571

k82cn opened this issue Jun 15, 2017 · 11 comments · Fixed by #47573
Assignees
Labels
sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Milestone

Comments

@k82cn
Copy link
Member

k82cn commented Jun 15, 2017

Is this a BUG REPORT or FEATURE REQUEST? (choose one):
Bug

Kubernetes version (use kubectl version):
master branch

What happened:

Here's the output when we print Quantity as string.

Volume Claims:
  Name:		www
  StorageClass:	anything
  Labels:	<none>
  Annotations:	volume.beta.kubernetes.io/storage-class=anything
  Capacity:	{{%!s(int64=1073741824) %!s(resource.Scale=0)} {%!s(*inf.Dec=<nil>)} 1Gi BinarySI}
  Access Modes:	[ReadWriteOnce]

What you expected to happen:
print 1Gi

How to reproduce it (as minimally and precisely as possible):
kubectl describe statefulsets

/assign

@k8s-github-robot
Copy link

@k82cn There are no sig labels on this issue. Please add a sig label by:
(1) mentioning a sig: @kubernetes/sig-<team-name>-misc
(2) specifying the label manually: /sig <label>

Note: method (1) will trigger a notification to the team. You can find the team list here and label list here

@k8s-github-robot k8s-github-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 15, 2017
@k82cn
Copy link
Member Author

k82cn commented Jun 15, 2017

/sig api-machinery

@k8s-ci-robot k8s-ci-robot added the sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. label Jun 15, 2017
@k82cn
Copy link
Member Author

k82cn commented Jun 15, 2017

/king bug

@k8s-github-robot k8s-github-robot removed the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jun 15, 2017
@verult
Copy link
Contributor

verult commented Jun 19, 2017

Here's the output I get with kubectl get pvc with a test PVC:

NAME      STATUS    VOLUME                                     CAPACITY   ACCESSMODES   STORAGECLASS   AGE
claim1    Bound     pvc-fdd9ff99-553e-11e7-98d1-42010a800008   30Gi       RWO           standard       2m

and kubectl version:

Client Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.0-alpha.0.690+3cb7796762047e", GitCommit:"3cb7796762047e42b880241cee87d40890217665", GitTreeState:"clean", BuildDate:"2017-06-19T21:00:14Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"8+", GitVersion:"v1.8.0-alpha.0.690+3cb7796762047e", GitCommit:"3cb7796762047e42b880241cee87d40890217665", GitTreeState:"clean", BuildDate:"2017-06-19T20:57:35Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

@saad-ali
Copy link
Member

Ditto, not seeing a repro against master head:

$ kubectl get pvc
NAME      STATUS    VOLUME                                     CAPACITY   ACCESSMODES   STORAGECLASS   AGE
claim1    Bound     pvc-a80053ba-5540-11e7-9577-42010af00002   30Gi       RWO           standard       1m

$ kubectl version
Client Version: version.Info{Major:"1", Minor:"7+", GitVersion:"v1.7.0-alpha.0.5949+227f52e0cb142f", GitCommit:"227f52e0cb142f5658598e3c981e0e637f8d9c08", GitTreeState:"clean", BuildDate:"2017-06-19T22:11:48Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"7+", GitVersion:"v1.7.0-alpha.0.5949+227f52e0cb142f", GitCommit:"227f52e0cb142f5658598e3c981e0e637f8d9c08", GitTreeState:"clean", BuildDate:"2017-06-19T22:08:50Z", GoVersion:"go1.8.3", Compiler:"gc", Platform:"linux/amd64"}

@k82cn
Copy link
Member Author

k82cn commented Jun 20, 2017

please try kubectl describe statefulsets :).

@k82cn k82cn changed the title kubectl did not print readable message of PVC's capacity. kubectl did not print readable message of statefulset PVC's capacity. Jun 20, 2017
@saad-ali
Copy link
Member

Ah, brainfart, I thought this was complaining about kubectl get pvc.

Yes, indeed kubectl describe statefulsets is returning:

$ kubectl describe statefulsets
Name:			web
Namespace:		default
CreationTimestamp:	Tue, 20 Jun 2017 09:50:03 -0700
Selector:		app=nginx
Labels:			app=nginx
Annotations:		<none>
Replicas:		3 desired | 1 total
Pods Status:		0 Running / 1 Waiting / 0 Succeeded / 0 Failed
Pod Template:
  Labels:	app=nginx
  Containers:
   nginx:
    Image:		gcr.io/google_containers/nginx-slim:0.8
    Port:		80/TCP
    Environment:	<none>
    Mounts:
      /usr/share/nginx/html from www (rw)
  Volumes:	<none>
Volume Claims:
  Name:		www
  StorageClass:	standard
  Labels:	<none>
  Annotations:	volume.beta.kubernetes.io/storage-class=standard
  Capacity:	{{%!s(int64=1073741824) %!s(resource.Scale=0)} {%!s(*inf.Dec=<nil>)} 1Gi BinarySI}

This should be fixed for 1.7.

@saad-ali
Copy link
Member

Will let @pwittrock add approved-for-milestone

@marun
Copy link
Contributor

marun commented Jun 20, 2017

@k82cn I'm assuming you're working on this?

@k82cn
Copy link
Member Author

k82cn commented Jun 20, 2017

@marun , yes, the PR is here, waiting for 1.7 milestone to merge :).

@k82cn
Copy link
Member Author

k82cn commented Jun 20, 2017

@saad-ali , thanks for your verification :). I updated title to include "statefulset".

k8s-github-robot pushed a commit that referenced this issue Jun 21, 2017
Automatic merge from submit-queue (batch tested with PRs 45268, 47573, 47632, 47818)

Fixed statefulset PVC's capacity in kubectl description.

**What this PR does / why we need it**:
We should use object instead of pointer for `String()`.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #47571 

**Release note**:

```release-note-none
Fix VolumeClaims/capacity in "kubectl describe statefulsets" output.
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants