Explicitly handle errors received during watch

Log them as Error and then continue.
This commit is contained in:
Clayton Coleman 2015-01-19 11:10:45 -05:00
parent eeb712d163
commit e4dcbb6edb

View File

@ -21,9 +21,11 @@ import (
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
"github.com/golang/glog"
)
@ -122,6 +124,10 @@ func (rm *ReplicationManager) watchControllers(resourceVersion *string) {
// that called us call us again.
return
}
if event.Type == watch.Error {
glog.Errorf("error from watch during sync: %v", errors.FromObject(event.Object))
continue
}
glog.V(4).Infof("Got watch: %#v", event)
rc, ok := event.Object.(*api.ReplicationController)
if !ok {