-
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
Support print volumeMode using kubectl get pv/pvc #76646
Conversation
Hi @cwdsuzhou. 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. |
PTAL thanks |
1 similar comment
PTAL thanks |
/assign @janetkuo |
/sig cli |
/cc @juanvallejo |
/assign @juanvallejo |
/ok-to-test |
ping @soltysh |
/assign @liggitt |
@@ -283,6 +283,7 @@ func AddHandlers(h printers.PrintHandler) { | |||
{Name: "Status", Type: "string", Description: apiv1.PersistentVolumeStatus{}.SwaggerDoc()["phase"]}, | |||
{Name: "Claim", Type: "string", Description: apiv1.PersistentVolumeSpec{}.SwaggerDoc()["claimRef"]}, | |||
{Name: "StorageClass", Type: "string", Description: "StorageClass of the pv"}, | |||
{Name: "VolumeMode", Type: "string", Description: apiv1.PersistentVolumeSpec{}.SwaggerDoc()["volumeMode"]}, |
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.
including volume mode seems fine, but should it be set as Priority: 1
so it only appears in wide mode? there are a lot of columns here already... how wide is a normal PV when 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.
Currently using kubectl get pv/pvc
or kubectl get pv/pvc -o wide
would get the same results. I not sure if it should be special for the column volumeMode
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.
as we exceed the number of columns that prints in an average terminal, we have to split into primary/secondary columns
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.
Done!
abe9f99
to
7ad49b1
Compare
/test pull-kubernetes-bazel-build |
|
||
row.Cells = append(row.Cells, obj.Name, aSize, modesStr, reclaimPolicyStr, |
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.
volumeMode must go in the same place as the header, which is currently the last column
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.
Done, seems the same reason with the next one
translateTimestampSince(obj.CreationTimestamp)) | ||
row.Cells = append(row.Cells, obj.Name, aSize, reclaimPolicyStr, | ||
string(phase), claimRefUID, helper.GetPersistentVolumeClass(obj), volumeMode, | ||
obj.Status.Reason, translateTimestampSince(obj.CreationTimestamp), modesStr) |
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.
it looks like this moved access modes to the end, not volumemode
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, my mistake. I found we lack pv unit tests, so I have not found it.
I have sent an PR to add some Unit tests.
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.
Done!
7ad49b1
to
6872cf2
Compare
/test pull-kubernetes-e2e-gce-100-performance |
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cwdsuzhou, liggitt 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
What this PR does / why we need it:
Currently , we can not get volumeMode using kubectl. This pr supports printing volumeMode using
kubectl get pv/pvc
Which issue(s) this PR fixes:
Fixes #
Special notes for your reviewer:
Does this PR introduce a user-facing change?: