mirror of
https://github.com/weaveworks/scope.git
synced 2026-07-28 01:31:17 +00:00
Upgrade k8s.io/client-go to kubernetes-1.9.1
Upgraded from 99c19923, branch release-3.0. This required fetching or upgrading the following: * k8s.io/api to kubernetes-1.9.1 * k8s.io/apimachinery to kubernetes-1.9.1 * github.com/juju/ratelimit to 1.0.1 * github.com/spf13/pflag to 4c012f6d Also, update Scope's imports/function calls to be compatible with the new client.
This commit is contained in:
1
vendor/github.com/gophercloud/gophercloud/internal/pkg.go
generated
vendored
Normal file
1
vendor/github.com/gophercloud/gophercloud/internal/pkg.go
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
package internal
|
||||
1
vendor/github.com/gophercloud/gophercloud/internal/testing/pkg.go
generated
vendored
Normal file
1
vendor/github.com/gophercloud/gophercloud/internal/testing/pkg.go
generated
vendored
Normal file
@@ -0,0 +1 @@
|
||||
package testing
|
||||
34
vendor/github.com/gophercloud/gophercloud/internal/util.go
generated
vendored
Normal file
34
vendor/github.com/gophercloud/gophercloud/internal/util.go
generated
vendored
Normal file
@@ -0,0 +1,34 @@
|
||||
package internal
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"strings"
|
||||
)
|
||||
|
||||
// RemainingKeys will inspect a struct and compare it to a map. Any struct
|
||||
// field that does not have a JSON tag that matches a key in the map or
|
||||
// a matching lower-case field in the map will be returned as an extra.
|
||||
//
|
||||
// This is useful for determining the extra fields returned in response bodies
|
||||
// for resources that can contain an arbitrary or dynamic number of fields.
|
||||
func RemainingKeys(s interface{}, m map[string]interface{}) (extras map[string]interface{}) {
|
||||
extras = make(map[string]interface{})
|
||||
for k, v := range m {
|
||||
extras[k] = v
|
||||
}
|
||||
|
||||
valueOf := reflect.ValueOf(s)
|
||||
typeOf := reflect.TypeOf(s)
|
||||
for i := 0; i < valueOf.NumField(); i++ {
|
||||
field := typeOf.Field(i)
|
||||
|
||||
lowerField := strings.ToLower(field.Name)
|
||||
delete(extras, lowerField)
|
||||
|
||||
if tagValue := field.Tag.Get("json"); tagValue != "" && tagValue != "-" {
|
||||
delete(extras, tagValue)
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user