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
Contributor

@cwdsuzhou cwdsuzhou 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 k8s-ci-robot added release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Apr 16, 2019
@k8s-ci-robot
Copy link
Contributor

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.

@k8s-ci-robot k8s-ci-robot added needs-priority Indicates a PR lacks a `priority/foo` label and requires one. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 16, 2019
@cwdsuzhou
Copy link
Contributor Author

@smarterclayton @shiywang

PTAL thanks

1 similar comment
@cwdsuzhou
Copy link
Contributor Author

@smarterclayton @shiywang

PTAL thanks

@cwdsuzhou
Copy link
Contributor Author

/assign @janetkuo

@cwdsuzhou
Copy link
Contributor Author

/sig cli
/kind feature

@k8s-ci-robot k8s-ci-robot added sig/cli Categorizes an issue or PR as relevant to SIG CLI. kind/feature Categorizes issue or PR as related to a new feature. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. labels Apr 16, 2019
@cwdsuzhou
Copy link
Contributor Author

/cc @juanvallejo
/assign @soltysh

@cwdsuzhou
Copy link
Contributor Author

/assign @juanvallejo

@juanvallejo
Copy link
Contributor

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

@k8s-ci-robot k8s-ci-robot added lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Apr 18, 2019
@cwdsuzhou
Copy link
Contributor Author

ping @soltysh

@cwdsuzhou
Copy link
Contributor Author

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

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?

Copy link
Contributor Author

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

Copy link
Member

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@k8s-ci-robot k8s-ci-robot removed the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 24, 2019
@cwdsuzhou
Copy link
Contributor Author

/test pull-kubernetes-bazel-build


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

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

Copy link
Contributor Author

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)
Copy link
Member

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

@cwdsuzhou
Copy link
Contributor Author

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

@liggitt
Copy link
Member

liggitt commented Apr 25, 2019

/lgtm
/approve

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Apr 25, 2019
@k8s-ci-robot
Copy link
Contributor

[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 added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 25, 2019
@k8s-ci-robot k8s-ci-robot merged commit e6188f8 into kubernetes:master Apr 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-priority Indicates a PR lacks a `priority/foo` label and requires one. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. sig/cli Categorizes an issue or PR as relevant to SIG CLI. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants