Refactor Kubelet config sources for clarity
Create a new "Pod" concept which can identify pods from many config sources.
This commit is contained in:
@@ -70,6 +70,11 @@ func IsEtcdConflict(err error) bool {
|
||||
return isEtcdErrorNum(err, 101)
|
||||
}
|
||||
|
||||
// IsEtcdWatchStoppedByUser returns true iff err is a client triggered stop.
|
||||
func IsEtcdWatchStoppedByUser(err error) bool {
|
||||
return etcd.ErrWatchStoppedByUser == err
|
||||
}
|
||||
|
||||
// Returns true iff err is an etcd error, whose errorCode matches errorCode
|
||||
func isEtcdErrorNum(err error, errorCode int) bool {
|
||||
etcdError, ok := err.(*etcd.EtcdError)
|
||||
|
@@ -124,6 +124,10 @@ func (f *FakeEtcdClient) Watch(prefix string, waitIndex uint64, recursive bool,
|
||||
defer close(injectedError)
|
||||
f.WatchInjectError = injectedError
|
||||
|
||||
if receiver == nil {
|
||||
return f.Get(prefix, false, recursive)
|
||||
}
|
||||
|
||||
f.watchCompletedChan <- true
|
||||
select {
|
||||
case <-stop:
|
||||
|
Reference in New Issue
Block a user