Re: [kubernetes/kubernetes] output which pods are a pvc in use when kubectl describe pvc is run (#65837)

9 views
Skip to first unread message

Yang Li

unread,
Jul 5, 2018, 10:25:43 AM7/5/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

@kubernetes/sig-storage-pr-reviews


You are receiving this because you are on a team that was mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

Juan Vallejo

unread,
Jul 5, 2018, 5:44:04 PM7/5/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

@juanvallejo commented on this pull request.


In pkg/printers/internalversion/describe.go:

>  	events, _ := d.Core().Events(namespace).Search(legacyscheme.Scheme, pvc)
 
-	return describePersistentVolumeClaim(pvc, events)
+	return describePersistentVolumeClaim(pvc, events, mountPods)
+}
+
+func getMountPods(c coreclient.PodInterface, pvcName string) ([]api.Pod, error) {
+	nsPods, err := c.List(metav1.ListOptions{})

Maybe we should set a limit as part of ListOptions in order to chunk potentially large responses? Don't feel strongly on this though cc @soltysh

Conor Landry

unread,
Jul 5, 2018, 11:54:24 PM7/5/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

@clandry94 commented on this pull request.


In pkg/printers/internalversion/describe.go:

>  	events, _ := d.Core().Events(namespace).Search(legacyscheme.Scheme, pvc)
 
-	return describePersistentVolumeClaim(pvc, events)
+	return describePersistentVolumeClaim(pvc, events, mountPods)
+}
+
+func getMountPods(c coreclient.PodInterface, pvcName string) ([]api.Pod, error) {
+	nsPods, err := c.List(metav1.ListOptions{})

I don't see any other usages of limiting ListOptions for other describe operations, so I figure that it hasn't been an issue yet. I have no opinion on the matter though, if you think we should set a limit, I will.

Maciej Szulik

unread,
Jul 6, 2018, 9:43:33 AM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

@soltysh commented on this pull request.


In pkg/printers/internalversion/describe.go:

>  	events, _ := d.Core().Events(namespace).Search(legacyscheme.Scheme, pvc)
 
-	return describePersistentVolumeClaim(pvc, events)
+	return describePersistentVolumeClaim(pvc, events, mountPods)
+}
+
+func getMountPods(c coreclient.PodInterface, pvcName string) ([]api.Pod, error) {
+	nsPods, err := c.List(metav1.ListOptions{})

I don't expect that list to be that long, besides kubectl describe can and should be verbose. It's in the kubectl get where we try to save space with more... and similar.

Maciej Szulik

unread,
Jul 6, 2018, 9:44:24 AM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

@soltysh approved this pull request.

/approve

Please squash your changes and we'll push it forward.

k8s-ci-robot

unread,
Jul 6, 2018, 9:45:14 AM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clandry94, soltysh

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

Conor Landry

unread,
Jul 6, 2018, 10:43:48 AM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

squashed 👍

Juan Vallejo

unread,
Jul 6, 2018, 10:45:38 AM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

/lgtm

k8s-ci-robot

unread,
Jul 6, 2018, 10:46:38 AM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: clandry94, juanvallejo, soltysh

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

Kubernetes Submit Queue

unread,
Jul 6, 2018, 12:13:28 PM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

/test all [submit-queue is verifying that this PR is safe to merge]

k8s-ci-robot

unread,
Jul 6, 2018, 1:15:03 PM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

@clandry94: The following test failed, say /retest to rerun them all:

Test name Commit Details Rerun command
pull-kubernetes-e2e-gce d956994 link /test pull-kubernetes-e2e-gce

Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR.

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. I understand the commands that are listed here.

Juan Vallejo

unread,
Jul 6, 2018, 1:23:18 PM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

/test pull-kubernetes-e2e-gce

Kubernetes Submit Queue

unread,
Jul 6, 2018, 2:04:14 PM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

Automatic merge from submit-queue (batch tested with PRs 65838, 65837). If you want to cherry-pick this change to another branch, please follow the instructions here.

Kubernetes Submit Queue

unread,
Jul 6, 2018, 2:04:26 PM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

Merged #65837.

Denis Salamanca

unread,
Jul 6, 2018, 2:39:03 PM7/6/18
to kubernetes/kubernetes, k8s-mirror-storage-pr-reviews, Team mention

Amazing! thanks @clandry94 for making this happen!

Reply all
Reply to author
Forward
0 new messages