From 5d6d35ab3d1b59d630cba30fd2bcd1b03a9ca87d Mon Sep 17 00:00:00 2001 From: Lantao Liu Date: Thu, 8 Nov 2018 18:21:28 -0800 Subject: [PATCH] Use metadata to filter instead of using labels. Signed-off-by: Lantao Liu --- cmd/crictl/sandbox.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/crictl/sandbox.go b/cmd/crictl/sandbox.go index 176ea380e4..caaa7558dd 100644 --- a/cmd/crictl/sandbox.go +++ b/cmd/crictl/sandbox.go @@ -433,10 +433,10 @@ func ListPodSandboxes(client pb.RuntimeServiceClient, opts listOptions) error { } for _, pod := range r.Items { // Filter by pod name/namespace regular expressions. - if !podMatchesRegex(opts.podNameRegexp, pod.Labels[kubePodNameLabel]) { + if !podMatchesRegex(opts.podNameRegexp, pod.Metadata.Name) { continue } - if !podMatchesRegex(opts.podNamespaceRegexp, pod.Labels[kubePodNamespaceLabel]) { + if !podMatchesRegex(opts.podNamespaceRegexp, pod.Metadata.Namespace) { continue }