Refactor Kubelet config sources for clarity

Create a new "Pod" concept which can identify pods from
many config sources.
This commit is contained in:
Clayton Coleman
2014-07-15 10:52:39 -04:00
parent f672edd1cf
commit 09294b90ce
15 changed files with 1553 additions and 8 deletions

View File

@@ -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)