diff --git a/vendor.conf b/vendor.conf index 7ea4e6f4..994433b9 100644 --- a/vendor.conf +++ b/vendor.conf @@ -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 diff --git a/vendor/github.com/rancher/norman/condition/condition.go b/vendor/github.com/rancher/norman/condition/condition.go index 1d848118..00d927c6 100644 --- a/vendor/github.com/rancher/norman/condition/condition.go +++ b/vendor/github.com/rancher/norman/condition/condition.go @@ -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) diff --git a/vendor/github.com/rancher/norman/controller/generic_controller.go b/vendor/github.com/rancher/norman/controller/generic_controller.go index c7e2ef05..c031431a 100644 --- a/vendor/github.com/rancher/norman/controller/generic_controller.go +++ b/vendor/github.com/rancher/norman/controller/generic_controller.go @@ -16,7 +16,7 @@ import ( ) var ( - resyncPeriod = 5 * time.Minute + resyncPeriod = 2 * time.Hour ) type HandlerFunc func(key string) error diff --git a/vendor/github.com/rancher/norman/types/convert/convert.go b/vendor/github.com/rancher/norman/types/convert/convert.go index a2a6c49a..c214ad49 100644 --- a/vendor/github.com/rancher/norman/types/convert/convert.go +++ b/vendor/github.com/rancher/norman/types/convert/convert.go @@ -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)) }