Make integration test pass.

This commit is contained in:
Daniel Smith
2014-08-21 13:35:50 -07:00
parent 29e9e13188
commit 0a1dfa366e
5 changed files with 27 additions and 6 deletions

View File

@@ -135,7 +135,6 @@ func (r *Registry) setPodHostTo(podID, oldMachine, machine string) (finalPod *ap
}
// assignPod assigns the given pod to the given machine.
// TODO: hook this up via apiserver, not by calling it from CreatePod().
func (r *Registry) assignPod(podID string, machine string) error {
finalPod, err := r.setPodHostTo(podID, "", machine)
if err != nil {

View File

@@ -133,10 +133,11 @@ func (rs *RegistryStorage) Watch(label, field labels.Selector, resourceVersion u
pod := e.Object.(*api.Pod)
fields := labels.Set{
"ID": pod.ID,
"DesiredState.Status": string(pod.CurrentState.Status),
"DesiredState.Host": pod.CurrentState.Host,
"DesiredState.Status": string(pod.DesiredState.Status),
"DesiredState.Host": pod.DesiredState.Host,
}
return e, label.Matches(labels.Set(pod.Labels)) && field.Matches(fields)
passesFilter := label.Matches(labels.Set(pod.Labels)) && field.Matches(fields)
return e, passesFilter
}), nil
}
@@ -158,6 +159,10 @@ func (rs *RegistryStorage) Update(obj interface{}) (<-chan interface{}, error) {
}
func (rs *RegistryStorage) fillPodInfo(pod *api.Pod) {
pod.CurrentState.Host = pod.DesiredState.Host
if pod.CurrentState.Host == "" {
return
}
// Get cached info for the list currently.
// TODO: Optionally use fresh info
if rs.podCache != nil {