PodInfo should indicate when a pod is not found

Client should react.  Also, dial down the chattiness of errors for
pods which do not exist and stop processing NotFound earlier in
the podinfo chain
This commit is contained in:
Clayton Coleman
2014-07-18 10:54:43 -04:00
parent 2f593c92fa
commit a17f0d04d4
6 changed files with 62 additions and 7 deletions

View File

@@ -17,7 +17,6 @@ limitations under the License.
package master
import (
"errors"
"sync"
"time"
@@ -57,7 +56,7 @@ func (p *PodCache) GetPodInfo(host, podID string) (api.PodInfo, error) {
defer p.podLock.Unlock()
value, ok := p.podInfo[podID]
if !ok {
return nil, errors.New("no cached pod info")
return nil, client.ErrPodInfoNotAvailable
}
return value, nil
}
@@ -82,7 +81,7 @@ func (p *PodCache) UpdateAllContainers() {
}
for _, pod := range pods {
err := p.updatePodInfo(pod.CurrentState.Host, pod.ID)
if err != nil {
if err != nil && err != client.ErrPodInfoNotAvailable {
glog.Errorf("Error synchronizing container: %#v", err)
}
}