Skip to content

Commit

Permalink
Use metadata to filter instead of using labels.
Browse files Browse the repository at this point in the history
Signed-off-by: Lantao Liu <lantaol@google.com>
  • Loading branch information
Random-Liu committed Nov 9, 2018
1 parent edabfb5 commit 5d6d35a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cmd/crictl/sandbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit 5d6d35a

Please # to comment.