mirror of
https://github.com/optim-enterprises-bv/kubernetes.git
synced 2025-11-20 00:15:11 +00:00
Explicitly handle errors received during watch
Log them as Error and then continue.
This commit is contained in:
@@ -21,9 +21,11 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
|
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/client"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/util"
|
||||||
|
"github.com/GoogleCloudPlatform/kubernetes/pkg/watch"
|
||||||
"github.com/golang/glog"
|
"github.com/golang/glog"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -122,6 +124,10 @@ func (rm *ReplicationManager) watchControllers(resourceVersion *string) {
|
|||||||
// that called us call us again.
|
// that called us call us again.
|
||||||
return
|
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)
|
glog.V(4).Infof("Got watch: %#v", event)
|
||||||
rc, ok := event.Object.(*api.ReplicationController)
|
rc, ok := event.Object.(*api.ReplicationController)
|
||||||
if !ok {
|
if !ok {
|
||||||
|
|||||||
Reference in New Issue
Block a user