mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 14:14:39 +00:00
Make integration test pass.
This commit is contained in:
@@ -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 {
|
||||
|
@@ -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 {
|
||||
|
Reference in New Issue
Block a user