Update godeps

This commit is contained in:
Manuel de Brito Fontes 2016-11-10 19:57:28 -03:00
parent 1c8773fc98
commit 1bc383f9c5
1723 changed files with 287976 additions and 411028 deletions

29
vendor/k8s.io/kubernetes/pkg/util/wait/BUILD generated vendored Normal file
View file

@ -0,0 +1,29 @@
package(default_visibility = ["//visibility:public"])
licenses(["notice"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_binary",
"go_library",
"go_test",
"cgo_library",
)
go_library(
name = "go_default_library",
srcs = [
"doc.go",
"wait.go",
],
tags = ["automanaged"],
deps = ["//pkg/util/runtime:go_default_library"],
)
go_test(
name = "go_default_test",
srcs = ["wait_test.go"],
library = "go_default_library",
tags = ["automanaged"],
deps = ["//pkg/util/runtime:go_default_library"],
)

View file

@ -20,6 +20,8 @@ import (
"errors"
"math/rand"
"time"
"k8s.io/kubernetes/pkg/util/runtime"
)
// For any test of the style:
@ -81,6 +83,7 @@ func JitterUntil(f func(), period time.Duration, jitterFactor float64, sliding b
}
func() {
defer runtime.HandleCrash()
f()
}()
@ -186,7 +189,26 @@ func pollImmediateInternal(wait WaitFunc, condition ConditionFunc) error {
func PollInfinite(interval time.Duration, condition ConditionFunc) error {
done := make(chan struct{})
defer close(done)
return WaitFor(poller(interval, 0), condition, done)
return PollUntil(interval, condition, done)
}
// PollImmediateInfinite is identical to PollInfinite, except that it
// performs the first check immediately, not waiting interval
// beforehand.
func PollImmediateInfinite(interval time.Duration, condition ConditionFunc) error {
done, err := condition()
if err != nil {
return err
}
if done {
return nil
}
return PollInfinite(interval, condition)
}
// PollUntil is like Poll, but it takes a stop change instead of total duration
func PollUntil(interval time.Duration, condition ConditionFunc, stopCh <-chan struct{}) error {
return WaitFor(poller(interval, 0), condition, stopCh)
}
// WaitFunc creates a channel that receives an item every time a test