mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-12 20:57:20 +00:00
Revert "Revert "Adding converter functions to convert field label selectors to internal version before matching""
This reverts commit 5f35a67002
.
This commit is contained in:
@@ -23,7 +23,6 @@ import (
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/rest"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/registry/generic"
|
||||
@@ -120,18 +119,10 @@ func MatchPod(label, field labels.Selector) generic.Matcher {
|
||||
// PodToSelectableFields returns a label set that represents the object
|
||||
// TODO: fields are not labels, and the validation rules for them do not apply.
|
||||
func PodToSelectableFields(pod *api.Pod) labels.Set {
|
||||
// TODO we are populating both Status and DesiredState because selectors are not aware of API versions
|
||||
// see https://github.com/GoogleCloudPlatform/kubernetes/pull/2503
|
||||
|
||||
var olderPodStatus v1beta1.PodStatus
|
||||
api.Scheme.Convert(pod.Status.Phase, &olderPodStatus)
|
||||
|
||||
return labels.Set{
|
||||
"name": pod.Name,
|
||||
"Status.Phase": string(pod.Status.Phase),
|
||||
"Status.Host": pod.Status.Host,
|
||||
"DesiredState.Status": string(olderPodStatus),
|
||||
"DesiredState.Host": pod.Status.Host,
|
||||
"name": pod.Name,
|
||||
"Status.Phase": string(pod.Status.Phase),
|
||||
"Status.Host": pod.Status.Host,
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user