mirror of
https://github.com/rancher/types.git
synced 2025-09-01 05:09:10 +00:00
Update vendor
This commit is contained in:
6
vendor/github.com/rancher/norman/condition/condition.go
generated
vendored
6
vendor/github.com/rancher/norman/condition/condition.go
generated
vendored
@@ -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)
|
||||
|
2
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
2
vendor/github.com/rancher/norman/controller/generic_controller.go
generated
vendored
@@ -16,7 +16,7 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
resyncPeriod = 5 * time.Minute
|
||||
resyncPeriod = 2 * time.Hour
|
||||
)
|
||||
|
||||
type HandlerFunc func(key string) error
|
||||
|
18
vendor/github.com/rancher/norman/types/convert/convert.go
generated
vendored
18
vendor/github.com/rancher/norman/types/convert/convert.go
generated
vendored
@@ -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))
|
||||
}
|
||||
|
Reference in New Issue
Block a user