vendor: remove dep and use vndr
Signed-off-by: Antonio Murdaca <runcom@redhat.com>
This commit is contained in:
parent
16f44674a4
commit
148e72d81e
16131 changed files with 73815 additions and 4235138 deletions
6
vendor/k8s.io/apimachinery/pkg/watch/until.go
generated
vendored
6
vendor/k8s.io/apimachinery/pkg/watch/until.go
generated
vendored
|
@ -17,6 +17,7 @@ limitations under the License.
|
|||
package watch
|
||||
|
||||
import (
|
||||
"errors"
|
||||
"time"
|
||||
|
||||
"k8s.io/apimachinery/pkg/util/wait"
|
||||
|
@ -28,6 +29,9 @@ import (
|
|||
// from false to true).
|
||||
type ConditionFunc func(event Event) (bool, error)
|
||||
|
||||
// errWatchClosed is returned when the watch channel is closed before timeout in Until.
|
||||
var errWatchClosed = errors.New("watch closed before Until timeout")
|
||||
|
||||
// Until reads items from the watch until each provided condition succeeds, and then returns the last watch
|
||||
// encountered. The first condition that returns an error terminates the watch (and the event is also returned).
|
||||
// If no event has been received, the returned event will be nil.
|
||||
|
@ -61,7 +65,7 @@ func Until(timeout time.Duration, watcher Interface, conditions ...ConditionFunc
|
|||
select {
|
||||
case event, ok := <-ch:
|
||||
if !ok {
|
||||
return lastEvent, wait.ErrWaitTimeout
|
||||
return lastEvent, errWatchClosed
|
||||
}
|
||||
lastEvent = &event
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue