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 <[email protected]>
  • Loading branch information
Random-Liu committed Nov 9, 2018
1 parent e4dff19 commit 5d3294d
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 @@ -447,10 +447,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 5d3294d

Please sign in to comment.