mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Fix incorrect error message in watch.Until
This commit is contained in:
parent
4cef1008f4
commit
51c7570ae1
@ -129,6 +129,9 @@ func Jitter(duration time.Duration, maxFactor float64) time.Duration {
|
||||
// ErrWaitTimeout is returned when the condition exited without success.
|
||||
var ErrWaitTimeout = errors.New("timed out waiting for the condition")
|
||||
|
||||
// ErrChannelClosed is returned when the watch channel is closed.
|
||||
var ErrChannelClosed = errors.New("watch channel closed")
|
||||
|
||||
// ConditionFunc returns true if the condition is satisfied, or an error
|
||||
// if the loop should be aborted.
|
||||
type ConditionFunc func() (done bool, err error)
|
||||
|
@ -61,7 +61,7 @@ func Until(timeout time.Duration, watcher Interface, conditions ...ConditionFunc
|
||||
select {
|
||||
case event, ok := <-ch:
|
||||
if !ok {
|
||||
return lastEvent, wait.ErrWaitTimeout
|
||||
return lastEvent, wait.ErrChannelClosed
|
||||
}
|
||||
lastEvent = &event
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user