diff --git a/cmd/crictl/constants.go b/cmd/crictl/constants.go deleted file mode 100644 index 2bfb962300..0000000000 --- a/cmd/crictl/constants.go +++ /dev/null @@ -1,24 +0,0 @@ -/* -Copyright 2018 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package main - -const ( - // This labels are copied from kubelet directly, and may change - // without warning in the future. - kubePodNameLabel = "io.kubernetes.pod.name" - kubePodNamespaceLabel = "io.kubernetes.pod.namespace" -) 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 }