mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 17:30:00 +00:00
Explicitly handle errors received during watch
Log them as Error and then continue.
This commit is contained in:
parent
eeb712d163
commit
e4dcbb6edb
@ -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 {
|
||||||
|
Loading…
Reference in New Issue
Block a user