Commit 16f57883 authored by bgrant0607's avatar bgrant0607

Merge pull request #2503 from markturansky/v1beta3_podrefactor

WIP: Missed a few fields in pod refactor
parents 3f74a1e9 13cba21c
...@@ -23,6 +23,7 @@ import ( ...@@ -23,6 +23,7 @@ import (
"github.com/GoogleCloudPlatform/kubernetes/pkg/api" "github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/v1beta1"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation" "github.com/GoogleCloudPlatform/kubernetes/pkg/api/validation"
"github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver" "github.com/GoogleCloudPlatform/kubernetes/pkg/apiserver"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client" "github.com/GoogleCloudPlatform/kubernetes/pkg/client"
...@@ -137,10 +138,19 @@ func (rs *REST) Get(ctx api.Context, id string) (runtime.Object, error) { ...@@ -137,10 +138,19 @@ func (rs *REST) Get(ctx api.Context, id string) (runtime.Object, error) {
} }
func (rs *REST) podToSelectableFields(pod *api.Pod) labels.Set { func (rs *REST) 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.Condition, &olderPodStatus)
return labels.Set{ return labels.Set{
"name": pod.Name, "name": pod.Name,
"Status.Condition": string(pod.Status.Condition), "Status.Condition": string(pod.Status.Condition),
"Status.Host": pod.Status.Host, "Status.Host": pod.Status.Host,
"DesiredState.Status": string(olderPodStatus),
"DesiredState.Host": pod.Status.Host,
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment