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

Support print volumeMode using kubectl get pv/pvc #76646

Merged
merged 1 commit into from Apr 26, 2019

Conversation

@cwdsuzhou
Copy link
Member

commented Apr 16, 2019

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?:

Support print volumeMode using `kubectl get pv/pvc -o wide`
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Apr 16, 2019

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 16, 2019

1 similar comment
@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 16, 2019

@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 16, 2019

/assign @janetkuo

@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 16, 2019

/sig cli
/kind feature

@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 17, 2019

/cc @juanvallejo
/assign @soltysh

@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 18, 2019

/assign @juanvallejo

@juanvallejo

This comment has been minimized.

Copy link
Member

commented Apr 18, 2019

/ok-to-test
/lgtm
cc @soltysh for approval

@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 20, 2019

ping @soltysh

@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 23, 2019

/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"]},

This comment has been minimized.

Copy link
@liggitt

liggitt Apr 23, 2019

Member

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?

This comment has been minimized.

Copy link
@cwdsuzhou

cwdsuzhou Apr 23, 2019

Author Member

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

This comment has been minimized.

Copy link
@liggitt

liggitt Apr 23, 2019

Member

as we exceed the number of columns that prints in an average terminal, we have to split into primary/secondary columns

This comment has been minimized.

Copy link
@cwdsuzhou

cwdsuzhou Apr 24, 2019

Author Member

Done!

@cwdsuzhou cwdsuzhou force-pushed the cwdsuzhou:print_volumeMode branch from abe9f99 to 7ad49b1 Apr 24, 2019

@k8s-ci-robot k8s-ci-robot removed the lgtm label Apr 24, 2019

@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 24, 2019

/test pull-kubernetes-bazel-build


row.Cells = append(row.Cells, obj.Name, aSize, modesStr, reclaimPolicyStr,

This comment has been minimized.

Copy link
@liggitt

liggitt Apr 24, 2019

Member

volumeMode must go in the same place as the header, which is currently the last column

This comment has been minimized.

Copy link
@cwdsuzhou

cwdsuzhou Apr 25, 2019

Author Member

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)

This comment has been minimized.

Copy link
@liggitt

liggitt Apr 24, 2019

Member

it looks like this moved access modes to the end, not volumemode

This comment has been minimized.

Copy link
@cwdsuzhou

cwdsuzhou Apr 24, 2019

Author Member

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.

This comment has been minimized.

Copy link
@cwdsuzhou

cwdsuzhou Apr 24, 2019

Author Member

Done!

@cwdsuzhou cwdsuzhou force-pushed the cwdsuzhou:print_volumeMode branch from 7ad49b1 to 6872cf2 Apr 24, 2019

@cwdsuzhou

This comment has been minimized.

Copy link
Member Author

commented Apr 25, 2019

/test pull-kubernetes-e2e-gce-100-performance

@liggitt

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm label Apr 25, 2019

@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Apr 25, 2019

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot merged commit e6188f8 into kubernetes:master Apr 26, 2019

20 checks passed

cla/linuxfoundation cwdsuzhou authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Skipped.
pull-kubernetes-dependencies Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-csi-serial Skipped.
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-e2e-gce-storage-slow Skipped.
pull-kubernetes-godeps Skipped.
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Skipped.
tide In merge pool.
Details
@cwdsuzhou cwdsuzhou referenced this pull request May 3, 2019
6 of 6 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.