1
0
mirror of https://github.com/rancher/types.git synced 2025-06-30 15:31:48 +00:00

Update vendor

This commit is contained in:
Darren Shepherd 2018-01-17 15:59:47 -07:00
parent 2a197d2490
commit f2db89cf88
4 changed files with 23 additions and 5 deletions

View File

@ -3,5 +3,5 @@ github.com/rancher/types
k8s.io/kubernetes v1.8.3 transitive=true,staging=true
bitbucket.org/ww/goautoneg a547fc61f48d567d5b4ec6f8aee5573d8efce11d https://github.com/rancher/goautoneg.git
github.com/rancher/norman 67264fa498b18ba881402e663d03d2f09c212d09
github.com/rancher/norman 9e6ea5644226d126f222b39ff81edbb81f6df35b
golang.org/x/sync fd80eb99c8f653c847d294a001bdf2a3a6f768f5

View File

@ -140,7 +140,11 @@ func (c Cond) doInternal(obj runtime.Object, f func() (runtime.Object, error)) (
}
if err != nil {
if _, ok := err.(*controller.ForgetError); !ok {
if _, ok := err.(*controller.ForgetError); ok {
if c.IsFalse(obj) {
c.Unknown(obj)
}
} else {
c.False(obj)
}
c.ReasonAndMessageFromError(obj, err)

View File

@ -16,7 +16,7 @@ import (
)
var (
resyncPeriod = 5 * time.Minute
resyncPeriod = 2 * time.Hour
)
type HandlerFunc func(key string) error

View File

@ -10,6 +10,20 @@ import (
"unicode"
)
func Chan(c <-chan map[string]interface{}, f func(map[string]interface{}) map[string]interface{}) chan map[string]interface{} {
result := make(chan map[string]interface{})
go func() {
for data := range c {
modified := f(data)
if modified != nil {
result <- modified
}
}
close(result)
}()
return result
}
func Singular(value interface{}) interface{} {
if slice, ok := value.([]string); ok {
if len(slice) == 0 {
@ -34,7 +48,7 @@ func ToString(value interface{}) string {
if single == nil {
return ""
}
return fmt.Sprint(single)
return strings.TrimSpace(fmt.Sprint(single))
}
func ToTimestamp(value interface{}) (int64, error) {
@ -150,7 +164,7 @@ func ToStringSlice(data interface{}) []string {
return v
}
if v, ok := data.([]interface{}); ok {
result := []string{}
var result []string
for _, item := range v {
result = append(result, ToString(item))
}