diff --git a/cmd/kube-aggregator/pkg/apiserver/BUILD b/cmd/kube-aggregator/pkg/apiserver/BUILD index f5c36a1f5bb..c1489bf8e72 100644 --- a/cmd/kube-aggregator/pkg/apiserver/BUILD +++ b/cmd/kube-aggregator/pkg/apiserver/BUILD @@ -56,7 +56,6 @@ go_library( "//pkg/client/informers/informers_generated:go_default_library", "//pkg/client/listers/core/v1:go_default_library", "//pkg/client/restclient:go_default_library", - "//pkg/client/transport:go_default_library", "//pkg/controller:go_default_library", "//pkg/genericapiserver:go_default_library", "//pkg/genericapiserver/api/filters:go_default_library", @@ -76,6 +75,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/util/runtime", "//vendor:k8s.io/apimachinery/pkg/util/wait", "//vendor:k8s.io/apiserver/pkg/request", + "//vendor:k8s.io/client-go/transport", ], ) diff --git a/cmd/kube-aggregator/pkg/apiserver/handler_proxy.go b/cmd/kube-aggregator/pkg/apiserver/handler_proxy.go index df6358382ca..b9b0001b001 100644 --- a/cmd/kube-aggregator/pkg/apiserver/handler_proxy.go +++ b/cmd/kube-aggregator/pkg/apiserver/handler_proxy.go @@ -23,8 +23,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" genericapirequest "k8s.io/apiserver/pkg/request" + "k8s.io/client-go/transport" "k8s.io/kubernetes/pkg/client/restclient" - "k8s.io/kubernetes/pkg/client/transport" "k8s.io/kubernetes/pkg/genericapiserver/api/handlers/responsewriters" genericrest "k8s.io/kubernetes/pkg/registry/generic/rest" "k8s.io/kubernetes/pkg/util/httpstream/spdy" diff --git a/hack/make-rules/test.sh b/hack/make-rules/test.sh index cd2286f03d6..26714e4399c 100755 --- a/hack/make-rules/test.sh +++ b/hack/make-rules/test.sh @@ -57,6 +57,10 @@ kube::test::find_dirs() { -o -path './test/e2e_node/system/*' \ -name '*_test.go' -print0 | xargs -0n1 dirname | sed "s|^\./|${KUBE_GO_PACKAGE}/|" | LC_ALL=C sort -u + # run tests for client-go + find ./staging/src/k8s.io/client-go -name '*_test.go' \ + -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./staging/src/|./vendor/|' | LC_ALL=C sort -u + # run tests for apiserver find ./staging/src/k8s.io/apiserver -name '*_test.go' \ -name '*_test.go' -print0 | xargs -0n1 dirname | sed 's|^\./staging/src/|./vendor/|' | LC_ALL=C sort -u diff --git a/pkg/BUILD b/pkg/BUILD index 2aa393a3bae..50e729d3cc5 100644 --- a/pkg/BUILD +++ b/pkg/BUILD @@ -73,7 +73,6 @@ filegroup( "//pkg/client/testdata:all-srcs", "//pkg/client/testing/cache:all-srcs", "//pkg/client/testing/core:all-srcs", - "//pkg/client/transport:all-srcs", "//pkg/client/typed/discovery:all-srcs", "//pkg/client/typed/dynamic:all-srcs", "//pkg/client/unversioned:all-srcs", diff --git a/pkg/client/restclient/BUILD b/pkg/client/restclient/BUILD index 678624aadb5..3b173cec268 100644 --- a/pkg/client/restclient/BUILD +++ b/pkg/client/restclient/BUILD @@ -27,7 +27,6 @@ go_library( "//pkg/api/validation/path:go_default_library", "//pkg/client/metrics:go_default_library", "//pkg/client/restclient/watch:go_default_library", - "//pkg/client/transport:go_default_library", "//pkg/client/unversioned/clientcmd/api:go_default_library", "//pkg/fields:go_default_library", "//pkg/util/cert:go_default_library", @@ -44,6 +43,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/util/net", "//vendor:k8s.io/apimachinery/pkg/util/sets", "//vendor:k8s.io/apimachinery/pkg/watch", + "//vendor:k8s.io/client-go/transport", ], ) diff --git a/pkg/client/restclient/transport.go b/pkg/client/restclient/transport.go index 48e8042ee80..0b4f5b6cbbd 100644 --- a/pkg/client/restclient/transport.go +++ b/pkg/client/restclient/transport.go @@ -20,7 +20,7 @@ import ( "crypto/tls" "net/http" - "k8s.io/kubernetes/pkg/client/transport" + "k8s.io/client-go/transport" ) // TLSConfigFor returns a tls.Config that will provide the transport level security defined diff --git a/pkg/client/transport/BUILD b/pkg/client/transport/BUILD deleted file mode 100644 index d2f4eaa2d1e..00000000000 --- a/pkg/client/transport/BUILD +++ /dev/null @@ -1,48 +0,0 @@ -package(default_visibility = ["//visibility:public"]) - -licenses(["notice"]) - -load( - "@io_bazel_rules_go//go:def.bzl", - "go_library", - "go_test", -) - -go_library( - name = "go_default_library", - srcs = [ - "cache.go", - "config.go", - "round_trippers.go", - "transport.go", - ], - tags = ["automanaged"], - deps = [ - "//vendor:github.com/golang/glog", - "//vendor:k8s.io/apimachinery/pkg/util/net", - ], -) - -go_test( - name = "go_default_test", - srcs = [ - "cache_test.go", - "round_trippers_test.go", - "transport_test.go", - ], - library = ":go_default_library", - tags = ["automanaged"], -) - -filegroup( - name = "package-srcs", - srcs = glob(["**"]), - tags = ["automanaged"], - visibility = ["//visibility:private"], -) - -filegroup( - name = "all-srcs", - srcs = [":package-srcs"], - tags = ["automanaged"], -) diff --git a/pkg/client/transport/OWNERS b/pkg/client/transport/OWNERS deleted file mode 100755 index bf0ba5b9f95..00000000000 --- a/pkg/client/transport/OWNERS +++ /dev/null @@ -1,7 +0,0 @@ -reviewers: -- smarterclayton -- wojtek-t -- deads2k -- liggitt -- krousey -- caesarxuchao diff --git a/pkg/client/transport/cache.go b/pkg/client/transport/cache.go deleted file mode 100644 index 8d76def345d..00000000000 --- a/pkg/client/transport/cache.go +++ /dev/null @@ -1,88 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package transport - -import ( - "fmt" - "net" - "net/http" - "sync" - "time" - - utilnet "k8s.io/apimachinery/pkg/util/net" -) - -// TlsTransportCache caches TLS http.RoundTrippers different configurations. The -// same RoundTripper will be returned for configs with identical TLS options If -// the config has no custom TLS options, http.DefaultTransport is returned. -type tlsTransportCache struct { - mu sync.Mutex - transports map[string]*http.Transport -} - -const idleConnsPerHost = 25 - -var tlsCache = &tlsTransportCache{transports: make(map[string]*http.Transport)} - -func (c *tlsTransportCache) get(config *Config) (http.RoundTripper, error) { - key, err := tlsConfigKey(config) - if err != nil { - return nil, err - } - - // Ensure we only create a single transport for the given TLS options - c.mu.Lock() - defer c.mu.Unlock() - - // See if we already have a custom transport for this config - if t, ok := c.transports[key]; ok { - return t, nil - } - - // Get the TLS options for this client config - tlsConfig, err := TLSConfigFor(config) - if err != nil { - return nil, err - } - // The options didn't require a custom TLS config - if tlsConfig == nil { - return http.DefaultTransport, nil - } - - // Cache a single transport for these options - c.transports[key] = utilnet.SetTransportDefaults(&http.Transport{ - Proxy: http.ProxyFromEnvironment, - TLSHandshakeTimeout: 10 * time.Second, - TLSClientConfig: tlsConfig, - MaxIdleConnsPerHost: idleConnsPerHost, - Dial: (&net.Dialer{ - Timeout: 30 * time.Second, - KeepAlive: 30 * time.Second, - }).Dial, - }) - return c.transports[key], nil -} - -// tlsConfigKey returns a unique key for tls.Config objects returned from TLSConfigFor -func tlsConfigKey(c *Config) (string, error) { - // Make sure ca/key/cert content is loaded - if err := loadTLSFiles(c); err != nil { - return "", err - } - // Only include the things that actually affect the tls.Config - return fmt.Sprintf("%v/%x/%x/%x", c.TLS.Insecure, c.TLS.CAData, c.TLS.CertData, c.TLS.KeyData), nil -} diff --git a/pkg/client/transport/cache_test.go b/pkg/client/transport/cache_test.go deleted file mode 100644 index eb9624d7edb..00000000000 --- a/pkg/client/transport/cache_test.go +++ /dev/null @@ -1,114 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package transport - -import ( - "net/http" - "testing" -) - -func TestTLSConfigKey(t *testing.T) { - // Make sure config fields that don't affect the tls config don't affect the cache key - identicalConfigurations := map[string]*Config{ - "empty": {}, - "basic": {Username: "bob", Password: "password"}, - "bearer": {BearerToken: "token"}, - "user agent": {UserAgent: "useragent"}, - "transport": {Transport: http.DefaultTransport}, - "wrap transport": {WrapTransport: func(http.RoundTripper) http.RoundTripper { return nil }}, - } - for nameA, valueA := range identicalConfigurations { - for nameB, valueB := range identicalConfigurations { - keyA, err := tlsConfigKey(valueA) - if err != nil { - t.Errorf("Unexpected error for %q: %v", nameA, err) - continue - } - keyB, err := tlsConfigKey(valueB) - if err != nil { - t.Errorf("Unexpected error for %q: %v", nameB, err) - continue - } - if keyA != keyB { - t.Errorf("Expected identical cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB) - continue - } - } - } - - // Make sure config fields that affect the tls config affect the cache key - uniqueConfigurations := map[string]*Config{ - "no tls": {}, - "insecure": {TLS: TLSConfig{Insecure: true}}, - "cadata 1": {TLS: TLSConfig{CAData: []byte{1}}}, - "cadata 2": {TLS: TLSConfig{CAData: []byte{2}}}, - "cert 1, key 1": { - TLS: TLSConfig{ - CertData: []byte{1}, - KeyData: []byte{1}, - }, - }, - "cert 1, key 2": { - TLS: TLSConfig{ - CertData: []byte{1}, - KeyData: []byte{2}, - }, - }, - "cert 2, key 1": { - TLS: TLSConfig{ - CertData: []byte{2}, - KeyData: []byte{1}, - }, - }, - "cert 2, key 2": { - TLS: TLSConfig{ - CertData: []byte{2}, - KeyData: []byte{2}, - }, - }, - "cadata 1, cert 1, key 1": { - TLS: TLSConfig{ - CAData: []byte{1}, - CertData: []byte{1}, - KeyData: []byte{1}, - }, - }, - } - for nameA, valueA := range uniqueConfigurations { - for nameB, valueB := range uniqueConfigurations { - // Don't compare to ourselves - if nameA == nameB { - continue - } - - keyA, err := tlsConfigKey(valueA) - if err != nil { - t.Errorf("Unexpected error for %q: %v", nameA, err) - continue - } - keyB, err := tlsConfigKey(valueB) - if err != nil { - t.Errorf("Unexpected error for %q: %v", nameB, err) - continue - } - if keyA == keyB { - t.Errorf("Expected unique cache keys for %q and %q, got:\n\t%s\n\t%s", nameA, nameB, keyA, keyB) - continue - } - } - } -} diff --git a/pkg/client/transport/config.go b/pkg/client/transport/config.go deleted file mode 100644 index eaad99fb2f2..00000000000 --- a/pkg/client/transport/config.go +++ /dev/null @@ -1,94 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package transport - -import "net/http" - -// Config holds various options for establishing a transport. -type Config struct { - // UserAgent is an optional field that specifies the caller of this - // request. - UserAgent string - - // The base TLS configuration for this transport. - TLS TLSConfig - - // Username and password for basic authentication - Username string - Password string - - // Bearer token for authentication - BearerToken string - - // Impersonate is the config that this Config will impersonate using - Impersonate ImpersonationConfig - - // Transport may be used for custom HTTP behavior. This attribute may - // not be specified with the TLS client certificate options. Use - // WrapTransport for most client level operations. - Transport http.RoundTripper - - // WrapTransport will be invoked for custom HTTP behavior after the - // underlying transport is initialized (either the transport created - // from TLSClientConfig, Transport, or http.DefaultTransport). The - // config may layer other RoundTrippers on top of the returned - // RoundTripper. - WrapTransport func(rt http.RoundTripper) http.RoundTripper -} - -// ImpersonationConfig has all the available impersonation options -type ImpersonationConfig struct { - // UserName matches user.Info.GetName() - UserName string - // Groups matches user.Info.GetGroups() - Groups []string - // Extra matches user.Info.GetExtra() - Extra map[string][]string -} - -// HasCA returns whether the configuration has a certificate authority or not. -func (c *Config) HasCA() bool { - return len(c.TLS.CAData) > 0 || len(c.TLS.CAFile) > 0 -} - -// HasBasicAuth returns whether the configuration has basic authentication or not. -func (c *Config) HasBasicAuth() bool { - return len(c.Username) != 0 -} - -// HasTokenAuth returns whether the configuration has token authentication or not. -func (c *Config) HasTokenAuth() bool { - return len(c.BearerToken) != 0 -} - -// HasCertAuth returns whether the configuration has certificate authentication or not. -func (c *Config) HasCertAuth() bool { - return len(c.TLS.CertData) != 0 || len(c.TLS.CertFile) != 0 -} - -// TLSConfig holds the information needed to set up a TLS transport. -type TLSConfig struct { - CAFile string // Path of the PEM-encoded server trusted root certificates. - CertFile string // Path of the PEM-encoded client certificate. - KeyFile string // Path of the PEM-encoded client key. - - Insecure bool // Server should be accessed without verifying the certificate. For testing only. - - CAData []byte // Bytes of the PEM-encoded server trusted root certificates. Supercedes CAFile. - CertData []byte // Bytes of the PEM-encoded client certificate. Supercedes CertFile. - KeyData []byte // Bytes of the PEM-encoded client key. Supercedes KeyFile. -} diff --git a/pkg/client/transport/round_trippers.go b/pkg/client/transport/round_trippers.go deleted file mode 100644 index a6f396fbb0a..00000000000 --- a/pkg/client/transport/round_trippers.go +++ /dev/null @@ -1,436 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package transport - -import ( - "fmt" - "net/http" - "strings" - "time" - - "github.com/golang/glog" -) - -// HTTPWrappersForConfig wraps a round tripper with any relevant layered -// behavior from the config. Exposed to allow more clients that need HTTP-like -// behavior but then must hijack the underlying connection (like WebSocket or -// HTTP2 clients). Pure HTTP clients should use the RoundTripper returned from -// New. -func HTTPWrappersForConfig(config *Config, rt http.RoundTripper) (http.RoundTripper, error) { - if config.WrapTransport != nil { - rt = config.WrapTransport(rt) - } - - rt = DebugWrappers(rt) - - // Set authentication wrappers - switch { - case config.HasBasicAuth() && config.HasTokenAuth(): - return nil, fmt.Errorf("username/password or bearer token may be set, but not both") - case config.HasTokenAuth(): - rt = NewBearerAuthRoundTripper(config.BearerToken, rt) - case config.HasBasicAuth(): - rt = NewBasicAuthRoundTripper(config.Username, config.Password, rt) - } - if len(config.UserAgent) > 0 { - rt = NewUserAgentRoundTripper(config.UserAgent, rt) - } - if len(config.Impersonate.UserName) > 0 || - len(config.Impersonate.Groups) > 0 || - len(config.Impersonate.Extra) > 0 { - rt = NewImpersonatingRoundTripper(config.Impersonate, rt) - } - return rt, nil -} - -// DebugWrappers wraps a round tripper and logs based on the current log level. -func DebugWrappers(rt http.RoundTripper) http.RoundTripper { - switch { - case bool(glog.V(9)): - rt = newDebuggingRoundTripper(rt, debugCurlCommand, debugURLTiming, debugResponseHeaders) - case bool(glog.V(8)): - rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus, debugResponseHeaders) - case bool(glog.V(7)): - rt = newDebuggingRoundTripper(rt, debugJustURL, debugRequestHeaders, debugResponseStatus) - case bool(glog.V(6)): - rt = newDebuggingRoundTripper(rt, debugURLTiming) - } - - return rt -} - -type requestCanceler interface { - CancelRequest(*http.Request) -} - -type authProxyRoundTripper struct { - username string - groups []string - extra map[string][]string - - rt http.RoundTripper -} - -// NewAuthProxyRoundTripper provides a roundtripper which will add auth proxy fields to requests for -// authentication terminating proxy cases -// assuming you pull the user from the context: -// username is the user.Info.GetName() of the user -// groups is the user.Info.GetGroups() of the user -// extra is the user.Info.GetExtra() of the user -// extra can contain any additional information that the authenticator -// thought was interesting, for example authorization scopes. -// In order to faithfully round-trip through an impersonation flow, these keys -// MUST be lowercase. -func NewAuthProxyRoundTripper(username string, groups []string, extra map[string][]string, rt http.RoundTripper) http.RoundTripper { - return &authProxyRoundTripper{ - username: username, - groups: groups, - extra: extra, - rt: rt, - } -} - -func (rt *authProxyRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - req = cloneRequest(req) - SetAuthProxyHeaders(req, rt.username, rt.groups, rt.extra) - - return rt.rt.RoundTrip(req) -} - -// SetAuthProxyHeaders stomps the auth proxy header fields. It mutates its argument. -func SetAuthProxyHeaders(req *http.Request, username string, groups []string, extra map[string][]string) { - req.Header.Del("X-Remote-User") - req.Header.Del("X-Remote-Group") - for key := range req.Header { - if strings.HasPrefix(strings.ToLower(key), strings.ToLower("X-Remote-Extra-")) { - req.Header.Del(key) - } - } - - req.Header.Set("X-Remote-User", username) - for _, group := range groups { - req.Header.Add("X-Remote-Group", group) - } - for key, values := range extra { - for _, value := range values { - req.Header.Add("X-Remote-Extra-"+key, value) - } - } -} - -func (rt *authProxyRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.rt.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - glog.Errorf("CancelRequest not implemented") - } -} - -func (rt *authProxyRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } - -type userAgentRoundTripper struct { - agent string - rt http.RoundTripper -} - -func NewUserAgentRoundTripper(agent string, rt http.RoundTripper) http.RoundTripper { - return &userAgentRoundTripper{agent, rt} -} - -func (rt *userAgentRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - if len(req.Header.Get("User-Agent")) != 0 { - return rt.rt.RoundTrip(req) - } - req = cloneRequest(req) - req.Header.Set("User-Agent", rt.agent) - return rt.rt.RoundTrip(req) -} - -func (rt *userAgentRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.rt.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - glog.Errorf("CancelRequest not implemented") - } -} - -func (rt *userAgentRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } - -type basicAuthRoundTripper struct { - username string - password string - rt http.RoundTripper -} - -// NewBasicAuthRoundTripper will apply a BASIC auth authorization header to a -// request unless it has already been set. -func NewBasicAuthRoundTripper(username, password string, rt http.RoundTripper) http.RoundTripper { - return &basicAuthRoundTripper{username, password, rt} -} - -func (rt *basicAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - if len(req.Header.Get("Authorization")) != 0 { - return rt.rt.RoundTrip(req) - } - req = cloneRequest(req) - req.SetBasicAuth(rt.username, rt.password) - return rt.rt.RoundTrip(req) -} - -func (rt *basicAuthRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.rt.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - glog.Errorf("CancelRequest not implemented") - } -} - -func (rt *basicAuthRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } - -// These correspond to the headers used in pkg/apis/authentication. We don't want the package dependency, -// but you must not change the values. -const ( - // ImpersonateUserHeader is used to impersonate a particular user during an API server request - ImpersonateUserHeader = "Impersonate-User" - - // ImpersonateGroupHeader is used to impersonate a particular group during an API server request. - // It can be repeated multiplied times for multiple groups. - ImpersonateGroupHeader = "Impersonate-Group" - - // ImpersonateUserExtraHeaderPrefix is a prefix for a header used to impersonate an entry in the - // extra map[string][]string for user.Info. The key for the `extra` map is suffix. - // The same key can be repeated multiple times to have multiple elements in the slice under a single key. - // For instance: - // Impersonate-Extra-Foo: one - // Impersonate-Extra-Foo: two - // results in extra["Foo"] = []string{"one", "two"} - ImpersonateUserExtraHeaderPrefix = "Impersonate-Extra-" -) - -type impersonatingRoundTripper struct { - impersonate ImpersonationConfig - delegate http.RoundTripper -} - -// NewImpersonatingRoundTripper will add an Act-As header to a request unless it has already been set. -func NewImpersonatingRoundTripper(impersonate ImpersonationConfig, delegate http.RoundTripper) http.RoundTripper { - return &impersonatingRoundTripper{impersonate, delegate} -} - -func (rt *impersonatingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - // use the user header as marker for the rest. - if len(req.Header.Get(ImpersonateUserHeader)) != 0 { - return rt.delegate.RoundTrip(req) - } - req = cloneRequest(req) - req.Header.Set(ImpersonateUserHeader, rt.impersonate.UserName) - - for _, group := range rt.impersonate.Groups { - req.Header.Add(ImpersonateGroupHeader, group) - } - for k, vv := range rt.impersonate.Extra { - for _, v := range vv { - req.Header.Add(ImpersonateUserExtraHeaderPrefix+k, v) - } - } - - return rt.delegate.RoundTrip(req) -} - -func (rt *impersonatingRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.delegate.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - glog.Errorf("CancelRequest not implemented") - } -} - -func (rt *impersonatingRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.delegate } - -type bearerAuthRoundTripper struct { - bearer string - rt http.RoundTripper -} - -// NewBearerAuthRoundTripper adds the provided bearer token to a request -// unless the authorization header has already been set. -func NewBearerAuthRoundTripper(bearer string, rt http.RoundTripper) http.RoundTripper { - return &bearerAuthRoundTripper{bearer, rt} -} - -func (rt *bearerAuthRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - if len(req.Header.Get("Authorization")) != 0 { - return rt.rt.RoundTrip(req) - } - - req = cloneRequest(req) - req.Header.Set("Authorization", fmt.Sprintf("Bearer %s", rt.bearer)) - return rt.rt.RoundTrip(req) -} - -func (rt *bearerAuthRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.rt.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - glog.Errorf("CancelRequest not implemented") - } -} - -func (rt *bearerAuthRoundTripper) WrappedRoundTripper() http.RoundTripper { return rt.rt } - -// cloneRequest returns a clone of the provided *http.Request. -// The clone is a shallow copy of the struct and its Header map. -func cloneRequest(r *http.Request) *http.Request { - // shallow copy of the struct - r2 := new(http.Request) - *r2 = *r - // deep copy of the Header - r2.Header = make(http.Header) - for k, s := range r.Header { - r2.Header[k] = s - } - return r2 -} - -// requestInfo keeps track of information about a request/response combination -type requestInfo struct { - RequestHeaders http.Header - RequestVerb string - RequestURL string - - ResponseStatus string - ResponseHeaders http.Header - ResponseErr error - - Duration time.Duration -} - -// newRequestInfo creates a new RequestInfo based on an http request -func newRequestInfo(req *http.Request) *requestInfo { - return &requestInfo{ - RequestURL: req.URL.String(), - RequestVerb: req.Method, - RequestHeaders: req.Header, - } -} - -// complete adds information about the response to the requestInfo -func (r *requestInfo) complete(response *http.Response, err error) { - if err != nil { - r.ResponseErr = err - return - } - r.ResponseStatus = response.Status - r.ResponseHeaders = response.Header -} - -// toCurl returns a string that can be run as a command in a terminal (minus the body) -func (r *requestInfo) toCurl() string { - headers := "" - for key, values := range r.RequestHeaders { - for _, value := range values { - headers += fmt.Sprintf(` -H %q`, fmt.Sprintf("%s: %s", key, value)) - } - } - - return fmt.Sprintf("curl -k -v -X%s %s %s", r.RequestVerb, headers, r.RequestURL) -} - -// debuggingRoundTripper will display information about the requests passing -// through it based on what is configured -type debuggingRoundTripper struct { - delegatedRoundTripper http.RoundTripper - - levels map[debugLevel]bool -} - -type debugLevel int - -const ( - debugJustURL debugLevel = iota - debugURLTiming - debugCurlCommand - debugRequestHeaders - debugResponseStatus - debugResponseHeaders -) - -func newDebuggingRoundTripper(rt http.RoundTripper, levels ...debugLevel) *debuggingRoundTripper { - drt := &debuggingRoundTripper{ - delegatedRoundTripper: rt, - levels: make(map[debugLevel]bool, len(levels)), - } - for _, v := range levels { - drt.levels[v] = true - } - return drt -} - -func (rt *debuggingRoundTripper) CancelRequest(req *http.Request) { - if canceler, ok := rt.delegatedRoundTripper.(requestCanceler); ok { - canceler.CancelRequest(req) - } else { - glog.Errorf("CancelRequest not implemented") - } -} - -func (rt *debuggingRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - reqInfo := newRequestInfo(req) - - if rt.levels[debugJustURL] { - glog.Infof("%s %s", reqInfo.RequestVerb, reqInfo.RequestURL) - } - if rt.levels[debugCurlCommand] { - glog.Infof("%s", reqInfo.toCurl()) - - } - if rt.levels[debugRequestHeaders] { - glog.Infof("Request Headers:") - for key, values := range reqInfo.RequestHeaders { - for _, value := range values { - glog.Infof(" %s: %s", key, value) - } - } - } - - startTime := time.Now() - response, err := rt.delegatedRoundTripper.RoundTrip(req) - reqInfo.Duration = time.Since(startTime) - - reqInfo.complete(response, err) - - if rt.levels[debugURLTiming] { - glog.Infof("%s %s %s in %d milliseconds", reqInfo.RequestVerb, reqInfo.RequestURL, reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) - } - if rt.levels[debugResponseStatus] { - glog.Infof("Response Status: %s in %d milliseconds", reqInfo.ResponseStatus, reqInfo.Duration.Nanoseconds()/int64(time.Millisecond)) - } - if rt.levels[debugResponseHeaders] { - glog.Infof("Response Headers:") - for key, values := range reqInfo.ResponseHeaders { - for _, value := range values { - glog.Infof(" %s: %s", key, value) - } - } - } - - return response, err -} - -func (rt *debuggingRoundTripper) WrappedRoundTripper() http.RoundTripper { - return rt.delegatedRoundTripper -} diff --git a/pkg/client/transport/round_trippers_test.go b/pkg/client/transport/round_trippers_test.go deleted file mode 100644 index d5ffc6bde30..00000000000 --- a/pkg/client/transport/round_trippers_test.go +++ /dev/null @@ -1,218 +0,0 @@ -/* -Copyright 2014 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package transport - -import ( - "net/http" - "reflect" - "strings" - "testing" -) - -type testRoundTripper struct { - Request *http.Request - Response *http.Response - Err error -} - -func (rt *testRoundTripper) RoundTrip(req *http.Request) (*http.Response, error) { - rt.Request = req - return rt.Response, rt.Err -} - -func TestBearerAuthRoundTripper(t *testing.T) { - rt := &testRoundTripper{} - req := &http.Request{} - NewBearerAuthRoundTripper("test", rt).RoundTrip(req) - if rt.Request == nil { - t.Fatalf("unexpected nil request: %v", rt) - } - if rt.Request == req { - t.Fatalf("round tripper should have copied request object: %#v", rt.Request) - } - if rt.Request.Header.Get("Authorization") != "Bearer test" { - t.Errorf("unexpected authorization header: %#v", rt.Request) - } -} - -func TestBasicAuthRoundTripper(t *testing.T) { - for n, tc := range map[string]struct { - user string - pass string - }{ - "basic": {user: "user", pass: "pass"}, - "no pass": {user: "user"}, - } { - rt := &testRoundTripper{} - req := &http.Request{} - NewBasicAuthRoundTripper(tc.user, tc.pass, rt).RoundTrip(req) - if rt.Request == nil { - t.Fatalf("%s: unexpected nil request: %v", n, rt) - } - if rt.Request == req { - t.Fatalf("%s: round tripper should have copied request object: %#v", n, rt.Request) - } - if user, pass, found := rt.Request.BasicAuth(); !found || user != tc.user || pass != tc.pass { - t.Errorf("%s: unexpected authorization header: %#v", n, rt.Request) - } - } -} - -func TestUserAgentRoundTripper(t *testing.T) { - rt := &testRoundTripper{} - req := &http.Request{ - Header: make(http.Header), - } - req.Header.Set("User-Agent", "other") - NewUserAgentRoundTripper("test", rt).RoundTrip(req) - if rt.Request == nil { - t.Fatalf("unexpected nil request: %v", rt) - } - if rt.Request != req { - t.Fatalf("round tripper should not have copied request object: %#v", rt.Request) - } - if rt.Request.Header.Get("User-Agent") != "other" { - t.Errorf("unexpected user agent header: %#v", rt.Request) - } - - req = &http.Request{} - NewUserAgentRoundTripper("test", rt).RoundTrip(req) - if rt.Request == nil { - t.Fatalf("unexpected nil request: %v", rt) - } - if rt.Request == req { - t.Fatalf("round tripper should have copied request object: %#v", rt.Request) - } - if rt.Request.Header.Get("User-Agent") != "test" { - t.Errorf("unexpected user agent header: %#v", rt.Request) - } -} - -func TestImpersonationRoundTripper(t *testing.T) { - tcs := []struct { - name string - impersonationConfig ImpersonationConfig - expected map[string][]string - }{ - { - name: "all", - impersonationConfig: ImpersonationConfig{ - UserName: "user", - Groups: []string{"one", "two"}, - Extra: map[string][]string{ - "first": {"A", "a"}, - "second": {"B", "b"}, - }, - }, - expected: map[string][]string{ - ImpersonateUserHeader: {"user"}, - ImpersonateGroupHeader: {"one", "two"}, - ImpersonateUserExtraHeaderPrefix + "First": {"A", "a"}, - ImpersonateUserExtraHeaderPrefix + "Second": {"B", "b"}, - }, - }, - } - - for _, tc := range tcs { - rt := &testRoundTripper{} - req := &http.Request{ - Header: make(http.Header), - } - NewImpersonatingRoundTripper(tc.impersonationConfig, rt).RoundTrip(req) - - for k, v := range rt.Request.Header { - expected, ok := tc.expected[k] - if !ok { - t.Errorf("%v missing %v=%v", tc.name, k, v) - continue - } - if !reflect.DeepEqual(expected, v) { - t.Errorf("%v expected %v: %v, got %v", tc.name, k, expected, v) - } - } - for k, v := range tc.expected { - expected, ok := rt.Request.Header[k] - if !ok { - t.Errorf("%v missing %v=%v", tc.name, k, v) - continue - } - if !reflect.DeepEqual(expected, v) { - t.Errorf("%v expected %v: %v, got %v", tc.name, k, expected, v) - } - } - } -} - -func TestAuthProxyRoundTripper(t *testing.T) { - for n, tc := range map[string]struct { - username string - groups []string - extra map[string][]string - }{ - "allfields": { - username: "user", - groups: []string{"groupA", "groupB"}, - extra: map[string][]string{ - "one": {"alpha", "bravo"}, - "two": {"charlie", "delta"}, - }, - }, - } { - rt := &testRoundTripper{} - req := &http.Request{} - NewAuthProxyRoundTripper(tc.username, tc.groups, tc.extra, rt).RoundTrip(req) - if rt.Request == nil { - t.Errorf("%s: unexpected nil request: %v", n, rt) - continue - } - if rt.Request == req { - t.Errorf("%s: round tripper should have copied request object: %#v", n, rt.Request) - continue - } - - actualUsernames, ok := rt.Request.Header["X-Remote-User"] - if !ok { - t.Errorf("%s missing value", n) - continue - } - if e, a := []string{tc.username}, actualUsernames; !reflect.DeepEqual(e, a) { - t.Errorf("%s expected %v, got %v", n, e, a) - continue - } - actualGroups, ok := rt.Request.Header["X-Remote-Group"] - if !ok { - t.Errorf("%s missing value", n) - continue - } - if e, a := tc.groups, actualGroups; !reflect.DeepEqual(e, a) { - t.Errorf("%s expected %v, got %v", n, e, a) - continue - } - - actualExtra := map[string][]string{} - for key, values := range rt.Request.Header { - if strings.HasPrefix(strings.ToLower(key), strings.ToLower("X-Remote-Extra-")) { - extraKey := strings.ToLower(key[len("X-Remote-Extra-"):]) - actualExtra[extraKey] = append(actualExtra[key], values...) - } - } - if e, a := tc.extra, actualExtra; !reflect.DeepEqual(e, a) { - t.Errorf("%s expected %v, got %v", n, e, a) - continue - } - } -} diff --git a/pkg/client/transport/transport.go b/pkg/client/transport/transport.go deleted file mode 100644 index 9c5b9ef3c32..00000000000 --- a/pkg/client/transport/transport.go +++ /dev/null @@ -1,140 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package transport - -import ( - "crypto/tls" - "crypto/x509" - "fmt" - "io/ioutil" - "net/http" -) - -// New returns an http.RoundTripper that will provide the authentication -// or transport level security defined by the provided Config. -func New(config *Config) (http.RoundTripper, error) { - // Set transport level security - if config.Transport != nil && (config.HasCA() || config.HasCertAuth() || config.TLS.Insecure) { - return nil, fmt.Errorf("using a custom transport with TLS certificate options or the insecure flag is not allowed") - } - - var ( - rt http.RoundTripper - err error - ) - - if config.Transport != nil { - rt = config.Transport - } else { - rt, err = tlsCache.get(config) - if err != nil { - return nil, err - } - } - - return HTTPWrappersForConfig(config, rt) -} - -// TLSConfigFor returns a tls.Config that will provide the transport level security defined -// by the provided Config. Will return nil if no transport level security is requested. -func TLSConfigFor(c *Config) (*tls.Config, error) { - if !(c.HasCA() || c.HasCertAuth() || c.TLS.Insecure) { - return nil, nil - } - if c.HasCA() && c.TLS.Insecure { - return nil, fmt.Errorf("specifying a root certificates file with the insecure flag is not allowed") - } - if err := loadTLSFiles(c); err != nil { - return nil, err - } - - tlsConfig := &tls.Config{ - // Can't use SSLv3 because of POODLE and BEAST - // Can't use TLSv1.0 because of POODLE and BEAST using CBC cipher - // Can't use TLSv1.1 because of RC4 cipher usage - MinVersion: tls.VersionTLS12, - InsecureSkipVerify: c.TLS.Insecure, - } - - if c.HasCA() { - tlsConfig.RootCAs = rootCertPool(c.TLS.CAData) - } - - if c.HasCertAuth() { - cert, err := tls.X509KeyPair(c.TLS.CertData, c.TLS.KeyData) - if err != nil { - return nil, err - } - tlsConfig.Certificates = []tls.Certificate{cert} - } - - return tlsConfig, nil -} - -// loadTLSFiles copies the data from the CertFile, KeyFile, and CAFile fields into the CertData, -// KeyData, and CAFile fields, or returns an error. If no error is returned, all three fields are -// either populated or were empty to start. -func loadTLSFiles(c *Config) error { - var err error - c.TLS.CAData, err = dataFromSliceOrFile(c.TLS.CAData, c.TLS.CAFile) - if err != nil { - return err - } - - c.TLS.CertData, err = dataFromSliceOrFile(c.TLS.CertData, c.TLS.CertFile) - if err != nil { - return err - } - - c.TLS.KeyData, err = dataFromSliceOrFile(c.TLS.KeyData, c.TLS.KeyFile) - if err != nil { - return err - } - return nil -} - -// dataFromSliceOrFile returns data from the slice (if non-empty), or from the file, -// or an error if an error occurred reading the file -func dataFromSliceOrFile(data []byte, file string) ([]byte, error) { - if len(data) > 0 { - return data, nil - } - if len(file) > 0 { - fileData, err := ioutil.ReadFile(file) - if err != nil { - return []byte{}, err - } - return fileData, nil - } - return nil, nil -} - -// rootCertPool returns nil if caData is empty. When passed along, this will mean "use system CAs". -// When caData is not empty, it will be the ONLY information used in the CertPool. -func rootCertPool(caData []byte) *x509.CertPool { - // What we really want is a copy of x509.systemRootsPool, but that isn't exposed. It's difficult to build (see the go - // code for a look at the platform specific insanity), so we'll use the fact that RootCAs == nil gives us the system values - // It doesn't allow trusting either/or, but hopefully that won't be an issue - if len(caData) == 0 { - return nil - } - - // if we have caData, use it - certPool := x509.NewCertPool() - certPool.AppendCertsFromPEM(caData) - return certPool -} diff --git a/pkg/client/transport/transport_test.go b/pkg/client/transport/transport_test.go deleted file mode 100644 index 4d2d78f86ce..00000000000 --- a/pkg/client/transport/transport_test.go +++ /dev/null @@ -1,204 +0,0 @@ -/* -Copyright 2015 The Kubernetes Authors. - -Licensed under the Apache License, Version 2.0 (the "License"); -you may not use this file except in compliance with the License. -You may obtain a copy of the License at - - http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, software -distributed under the License is distributed on an "AS IS" BASIS, -WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -See the License for the specific language governing permissions and -limitations under the License. -*/ - -package transport - -import ( - "net/http" - "testing" -) - -const ( - rootCACert = `-----BEGIN CERTIFICATE----- -MIIC4DCCAcqgAwIBAgIBATALBgkqhkiG9w0BAQswIzEhMB8GA1UEAwwYMTAuMTMu -MTI5LjEwNkAxNDIxMzU5MDU4MB4XDTE1MDExNTIxNTczN1oXDTE2MDExNTIxNTcz -OFowIzEhMB8GA1UEAwwYMTAuMTMuMTI5LjEwNkAxNDIxMzU5MDU4MIIBIjANBgkq -hkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAunDRXGwsiYWGFDlWH6kjGun+PshDGeZX -xtx9lUnL8pIRWH3wX6f13PO9sktaOWW0T0mlo6k2bMlSLlSZgG9H6og0W6gLS3vq -s4VavZ6DbXIwemZG2vbRwsvR+t4G6Nbwelm6F8RFnA1Fwt428pavmNQ/wgYzo+T1 -1eS+HiN4ACnSoDSx3QRWcgBkB1g6VReofVjx63i0J+w8Q/41L9GUuLqquFxu6ZnH -60vTB55lHgFiDLjA1FkEz2dGvGh/wtnFlRvjaPC54JH2K1mPYAUXTreoeJtLJKX0 -ycoiyB24+zGCniUmgIsmQWRPaOPircexCp1BOeze82BT1LCZNTVaxQIDAQABoyMw -ITAOBgNVHQ8BAf8EBAMCAKQwDwYDVR0TAQH/BAUwAwEB/zALBgkqhkiG9w0BAQsD -ggEBADMxsUuAFlsYDpF4fRCzXXwrhbtj4oQwcHpbu+rnOPHCZupiafzZpDu+rw4x -YGPnCb594bRTQn4pAu3Ac18NbLD5pV3uioAkv8oPkgr8aUhXqiv7KdDiaWm6sbAL -EHiXVBBAFvQws10HMqMoKtO8f1XDNAUkWduakR/U6yMgvOPwS7xl0eUTqyRB6zGb -K55q2dejiFWaFqB/y78txzvz6UlOZKE44g2JAVoJVM6kGaxh33q8/FmrL4kuN3ut -W+MmJCVDvd4eEqPwbp7146ZWTqpIJ8lvA6wuChtqV8lhAPka2hD/LMqY8iXNmfXD -uml0obOEy+ON91k+SWTJ3ggmF/U= ------END CERTIFICATE-----` - - certData = `-----BEGIN CERTIFICATE----- -MIIC6jCCAdSgAwIBAgIBCzALBgkqhkiG9w0BAQswIzEhMB8GA1UEAwwYMTAuMTMu -MTI5LjEwNkAxNDIxMzU5MDU4MB4XDTE1MDExNTIyMDEzMVoXDTE2MDExNTIyMDEz -MlowGzEZMBcGA1UEAxMQb3BlbnNoaWZ0LWNsaWVudDCCASIwDQYJKoZIhvcNAQEB -BQADggEPADCCAQoCggEBAKtdhz0+uCLXw5cSYns9rU/XifFSpb/x24WDdrm72S/v -b9BPYsAStiP148buylr1SOuNi8sTAZmlVDDIpIVwMLff+o2rKYDicn9fjbrTxTOj -lI4pHJBH+JU3AJ0tbajupioh70jwFS0oYpwtneg2zcnE2Z4l6mhrj2okrc5Q1/X2 -I2HChtIU4JYTisObtin10QKJX01CLfYXJLa8upWzKZ4/GOcHG+eAV3jXWoXidtjb -1Usw70amoTZ6mIVCkiu1QwCoa8+ycojGfZhvqMsAp1536ZcCul+Na+AbCv4zKS7F -kQQaImVrXdUiFansIoofGlw/JNuoKK6ssVpS5Ic3pgcCAwEAAaM1MDMwDgYDVR0P -AQH/BAQDAgCgMBMGA1UdJQQMMAoGCCsGAQUFBwMCMAwGA1UdEwEB/wQCMAAwCwYJ -KoZIhvcNAQELA4IBAQCKLREH7bXtXtZ+8vI6cjD7W3QikiArGqbl36bAhhWsJLp/ -p/ndKz39iFNaiZ3GlwIURWOOKx3y3GA0x9m8FR+Llthf0EQ8sUjnwaknWs0Y6DQ3 -jjPFZOpV3KPCFrdMJ3++E3MgwFC/Ih/N2ebFX9EcV9Vcc6oVWMdwT0fsrhu683rq -6GSR/3iVX1G/pmOiuaR0fNUaCyCfYrnI4zHBDgSfnlm3vIvN2lrsR/DQBakNL8DJ -HBgKxMGeUPoneBv+c8DMXIL0EhaFXRlBv9QW45/GiAIOuyFJ0i6hCtGZpJjq4OpQ -BRjCI+izPzFTjsxD4aORE+WOkyWFCGPWKfNejfw0 ------END CERTIFICATE-----` - - keyData = `-----BEGIN RSA PRIVATE KEY----- -MIIEowIBAAKCAQEAq12HPT64ItfDlxJiez2tT9eJ8VKlv/HbhYN2ubvZL+9v0E9i -wBK2I/Xjxu7KWvVI642LyxMBmaVUMMikhXAwt9/6jaspgOJyf1+NutPFM6OUjikc -kEf4lTcAnS1tqO6mKiHvSPAVLShinC2d6DbNycTZniXqaGuPaiStzlDX9fYjYcKG -0hTglhOKw5u2KfXRAolfTUIt9hcktry6lbMpnj8Y5wcb54BXeNdaheJ22NvVSzDv -RqahNnqYhUKSK7VDAKhrz7JyiMZ9mG+oywCnXnfplwK6X41r4BsK/jMpLsWRBBoi -ZWtd1SIVqewiih8aXD8k26gorqyxWlLkhzemBwIDAQABAoIBAD2XYRs3JrGHQUpU -FkdbVKZkvrSY0vAZOqBTLuH0zUv4UATb8487anGkWBjRDLQCgxH+jucPTrztekQK -aW94clo0S3aNtV4YhbSYIHWs1a0It0UdK6ID7CmdWkAj6s0T8W8lQT7C46mWYVLm -5mFnCTHi6aB42jZrqmEpC7sivWwuU0xqj3Ml8kkxQCGmyc9JjmCB4OrFFC8NNt6M -ObvQkUI6Z3nO4phTbpxkE1/9dT0MmPIF7GhHVzJMS+EyyRYUDllZ0wvVSOM3qZT0 -JMUaBerkNwm9foKJ1+dv2nMKZZbJajv7suUDCfU44mVeaEO+4kmTKSGCGjjTBGkr -7L1ySDECgYEA5ElIMhpdBzIivCuBIH8LlUeuzd93pqssO1G2Xg0jHtfM4tz7fyeI -cr90dc8gpli24dkSxzLeg3Tn3wIj/Bu64m2TpZPZEIlukYvgdgArmRIPQVxerYey -OkrfTNkxU1HXsYjLCdGcGXs5lmb+K/kuTcFxaMOs7jZi7La+jEONwf8CgYEAwCs/ -rUOOA0klDsWWisbivOiNPII79c9McZCNBqncCBfMUoiGe8uWDEO4TFHN60vFuVk9 -8PkwpCfvaBUX+ajvbafIfHxsnfk1M04WLGCeqQ/ym5Q4sQoQOcC1b1y9qc/xEWfg -nIUuia0ukYRpl7qQa3tNg+BNFyjypW8zukUAC/kCgYB1/Kojuxx5q5/oQVPrx73k -2bevD+B3c+DYh9MJqSCNwFtUpYIWpggPxoQan4LwdsmO0PKzocb/ilyNFj4i/vII -NToqSc/WjDFpaDIKyuu9oWfhECye45NqLWhb/6VOuu4QA/Nsj7luMhIBehnEAHW+ -GkzTKM8oD1PxpEG3nPKXYQKBgQC6AuMPRt3XBl1NkCrpSBy/uObFlFaP2Enpf39S -3OZ0Gv0XQrnSaL1kP8TMcz68rMrGX8DaWYsgytstR4W+jyy7WvZwsUu+GjTJ5aMG -77uEcEBpIi9CBzivfn7hPccE8ZgqPf+n4i6q66yxBJflW5xhvafJqDtW2LcPNbW/ -bvzdmQKBgExALRUXpq+5dbmkdXBHtvXdRDZ6rVmrnjy4nI5bPw+1GqQqk6uAR6B/ -F6NmLCQOO4PDG/cuatNHIr2FrwTmGdEL6ObLUGWn9Oer9gJhHVqqsY5I4sEPo4XX -stR0Yiw0buV6DL/moUO0HIM9Bjh96HJp+LxiIS6UCdIhMPp5HoQa ------END RSA PRIVATE KEY-----` -) - -func TestNew(t *testing.T) { - testCases := map[string]struct { - Config *Config - Err bool - TLS bool - Default bool - }{ - "default transport": { - Default: true, - Config: &Config{}, - }, - - "ca transport": { - TLS: true, - Config: &Config{ - TLS: TLSConfig{ - CAData: []byte(rootCACert), - }, - }, - }, - "bad ca file transport": { - Err: true, - Config: &Config{ - TLS: TLSConfig{ - CAFile: "invalid file", - }, - }, - }, - "ca data overriding bad ca file transport": { - TLS: true, - Config: &Config{ - TLS: TLSConfig{ - CAData: []byte(rootCACert), - CAFile: "invalid file", - }, - }, - }, - - "cert transport": { - TLS: true, - Config: &Config{ - TLS: TLSConfig{ - CAData: []byte(rootCACert), - CertData: []byte(certData), - KeyData: []byte(keyData), - }, - }, - }, - "bad cert data transport": { - Err: true, - Config: &Config{ - TLS: TLSConfig{ - CAData: []byte(rootCACert), - CertData: []byte(certData), - KeyData: []byte("bad key data"), - }, - }, - }, - "bad file cert transport": { - Err: true, - Config: &Config{ - TLS: TLSConfig{ - CAData: []byte(rootCACert), - CertData: []byte(certData), - KeyFile: "invalid file", - }, - }, - }, - "key data overriding bad file cert transport": { - TLS: true, - Config: &Config{ - TLS: TLSConfig{ - CAData: []byte(rootCACert), - CertData: []byte(certData), - KeyData: []byte(keyData), - KeyFile: "invalid file", - }, - }, - }, - } - for k, testCase := range testCases { - transport, err := New(testCase.Config) - switch { - case testCase.Err && err == nil: - t.Errorf("%s: unexpected non-error", k) - continue - case !testCase.Err && err != nil: - t.Errorf("%s: unexpected error: %v", k, err) - continue - } - - switch { - case testCase.Default && transport != http.DefaultTransport: - t.Errorf("%s: expected the default transport, got %#v", k, transport) - continue - case !testCase.Default && transport == http.DefaultTransport: - t.Errorf("%s: expected non-default transport, got %#v", k, transport) - continue - } - - // We only know how to check TLSConfig on http.Transports - if transport, ok := transport.(*http.Transport); ok { - switch { - case testCase.TLS && transport.TLSClientConfig == nil: - t.Errorf("%s: expected TLSClientConfig, got %#v", k, transport) - continue - case !testCase.TLS && transport.TLSClientConfig != nil: - t.Errorf("%s: expected no TLSClientConfig, got %#v", k, transport) - continue - } - } - } -} diff --git a/pkg/client/unversioned/remotecommand/BUILD b/pkg/client/unversioned/remotecommand/BUILD index 1f886caa269..7cdd440e724 100644 --- a/pkg/client/unversioned/remotecommand/BUILD +++ b/pkg/client/unversioned/remotecommand/BUILD @@ -23,7 +23,6 @@ go_library( deps = [ "//pkg/api:go_default_library", "//pkg/client/restclient:go_default_library", - "//pkg/client/transport:go_default_library", "//pkg/kubelet/server/remotecommand:go_default_library", "//pkg/util/exec:go_default_library", "//pkg/util/httpstream:go_default_library", @@ -32,6 +31,7 @@ go_library( "//vendor:github.com/golang/glog", "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/util/runtime", + "//vendor:k8s.io/client-go/transport", ], ) diff --git a/pkg/client/unversioned/remotecommand/remotecommand.go b/pkg/client/unversioned/remotecommand/remotecommand.go index 0cee2285648..dd4fd5ed6e4 100644 --- a/pkg/client/unversioned/remotecommand/remotecommand.go +++ b/pkg/client/unversioned/remotecommand/remotecommand.go @@ -24,8 +24,8 @@ import ( "github.com/golang/glog" + "k8s.io/client-go/transport" "k8s.io/kubernetes/pkg/client/restclient" - "k8s.io/kubernetes/pkg/client/transport" "k8s.io/kubernetes/pkg/kubelet/server/remotecommand" "k8s.io/kubernetes/pkg/util/httpstream" "k8s.io/kubernetes/pkg/util/httpstream/spdy" diff --git a/pkg/kubelet/client/BUILD b/pkg/kubelet/client/BUILD index 7da01585534..d6b57b7b651 100644 --- a/pkg/kubelet/client/BUILD +++ b/pkg/kubelet/client/BUILD @@ -15,11 +15,11 @@ go_library( deps = [ "//pkg/api/v1:go_default_library", "//pkg/client/restclient:go_default_library", - "//pkg/client/transport:go_default_library", "//pkg/util/node:go_default_library", "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/util/net", + "//vendor:k8s.io/client-go/transport", ], ) diff --git a/pkg/kubelet/client/kubelet_client.go b/pkg/kubelet/client/kubelet_client.go index d004e28e798..3df67c78681 100644 --- a/pkg/kubelet/client/kubelet_client.go +++ b/pkg/kubelet/client/kubelet_client.go @@ -24,9 +24,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" utilnet "k8s.io/apimachinery/pkg/util/net" + "k8s.io/client-go/transport" "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/client/restclient" - "k8s.io/kubernetes/pkg/client/transport" nodeutil "k8s.io/kubernetes/pkg/util/node" ) diff --git a/staging/copy.sh b/staging/copy.sh index 3ea89cf658e..c48b1f6ebe1 100755 --- a/staging/copy.sh +++ b/staging/copy.sh @@ -55,11 +55,29 @@ echo "creating the tmp directory" mkdir -p "${CLIENT_REPO_TEMP}" cd "${CLIENT_REPO}" +# there are two classes of package in staging/client-go, those which are authoritative (client-go has the only copy) +# and those which are copied and rewritten (client-go is not authoritative). +# we first copy out the authoritative packages to the temp location, then copy non-authoritative packages +# then save over the original + + +# save copies code from client-go into the temp folder to make sure we don't lose it by accident +# TODO this is temporary until everything in certain directories is authoritative +function save() { + cp -r "${CLIENT_REPO}/$1" "${CLIENT_REPO_TEMP}" +} + +# save everything for which the staging directory is the source of truth +save "/transport" + + + # mkcp copies file from the main repo to the client repo, it creates the directory if it doesn't exist in the client repo. function mkcp() { mkdir -p "${CLIENT_REPO_TEMP}/$2" && cp -r "${MAIN_REPO}/$1" "${CLIENT_REPO_TEMP}/$2" } +# assemble all the other parts of the staging directory echo "copying client packages" mkcp "pkg/client/clientset_generated/${CLIENTSET}" "pkg/client/clientset_generated" mkcp "/pkg/client/record" "/pkg/client" @@ -70,7 +88,6 @@ mkcp "/pkg/client/restclient" "/pkg/client" mkcp "/pkg/client/testing" "/pkg/client" # remove this test because it imports the internal clientset rm "${CLIENT_REPO_TEMP}"/pkg/client/testing/core/fake_test.go -mkcp "/pkg/client/transport" "/pkg/client" mkcp "/pkg/client/typed" "/pkg/client" mkcp "/pkg/client/unversioned/auth" "/pkg/client/unversioned" @@ -170,7 +187,6 @@ function mvfolder { mvfolder "pkg/client/clientset_generated/${CLIENTSET}" kubernetes mvfolder pkg/client/typed/discovery discovery mvfolder pkg/client/typed/dynamic dynamic -mvfolder pkg/client/transport transport mvfolder pkg/client/record tools/record mvfolder pkg/client/restclient rest mvfolder pkg/client/cache tools/cache @@ -202,6 +218,9 @@ find "${CLIENT_REPO_TEMP}" -type f \( \ -name "*.sh" \ \) -delete +echo "remove cyclical godep" +rm -rf "${CLIENT_REPO_TEMP}/_vendor/k8s.io/client-go" + if [ "${VERIFYONLY}" = true ]; then echo "running verify-only" ret=0 diff --git a/staging/godeps-json-updater.go b/staging/godeps-json-updater.go index a9a66d379f6..7f8fbe985d3 100644 --- a/staging/godeps-json-updater.go +++ b/staging/godeps-json-updater.go @@ -70,6 +70,9 @@ func main() { if strings.Contains(dep.ImportPath, "k8s.io/kubernetes") { continue } + if strings.Contains(dep.ImportPath, "k8s.io/client-go") { + continue + } g.Deps[i] = dep i++ } diff --git a/staging/src/k8s.io/client-go/Godeps/Godeps.json b/staging/src/k8s.io/client-go/Godeps/Godeps.json index 140ff3f2a84..ca7ac927357 100644 --- a/staging/src/k8s.io/client-go/Godeps/Godeps.json +++ b/staging/src/k8s.io/client-go/Godeps/Godeps.json @@ -322,137 +322,145 @@ "ImportPath": "gopkg.in/yaml.v2", "Rev": "53feefa2559fb8dfa8d81baad31be332c97d6c77" }, + { + "ImportPath": "k8s.io/apimachinery/pkg/api/errors", + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" + }, { "ImportPath": "k8s.io/apimachinery/pkg/api/meta", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/apimachinery/registered", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" - }, - { - "ImportPath": "k8s.io/apimachinery/pkg/genericapiserver/openapi/common", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/labels", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/openapi", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/selection", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/types", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/diff", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/errors", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/framer", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/json", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/net", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/util/rand", + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/runtime", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/sets", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/wait", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/util/yaml", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" + }, + { + "ImportPath": "k8s.io/apimachinery/pkg/version", + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/pkg/watch", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" }, { "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", - "Rev": "40b9317c36d3e02d20da77c4233f4a22af6831f8" + "Rev": "fd5da6b9d070d172e9677941ced569deabdd05ea" } ] } diff --git a/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go index 0cc65f1b4e6..f000655d947 100644 --- a/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go +++ b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/apis/meta/v1/types_swagger_doc_generated.go @@ -140,6 +140,29 @@ func (ListMeta) SwaggerDoc() map[string]string { return map_ListMeta } +var map_ObjectMeta = map[string]string{ + "": "ObjectMeta is metadata that all persisted resources must have, which includes all objects users must create.", + "name": "Name must be unique within a namespace. Is required when creating resources, although some resources may allow a client to request the generation of an appropriate name automatically. Name is primarily intended for creation idempotence and configuration definition. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/identifiers#names", + "generateName": "GenerateName is an optional prefix, used by the server, to generate a unique name ONLY IF the Name field has not been provided. If this field is used, the name returned to the client will be different than the name passed. This value will also be combined with a unique suffix. The provided value has the same validation rules as the Name field, and may be truncated by the length of the suffix required to make the value unique on the server.\n\nIf this field is specified and the generated name exists, the server will NOT return a 409 - instead, it will either return 201 Created or 500 with Reason ServerTimeout indicating a unique name could not be found in the time allotted, and the client should retry (optionally after the time indicated in the Retry-After header).\n\nApplied only if Name is not specified. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#idempotency", + "namespace": "Namespace defines the space within each name must be unique. An empty namespace is equivalent to the \"default\" namespace, but \"default\" is the canonical representation. Not all objects are required to be scoped to a namespace - the value of this field for those objects will be empty.\n\nMust be a DNS_LABEL. Cannot be updated. More info: http://kubernetes.io/docs/user-guide/namespaces", + "selfLink": "SelfLink is a URL representing this object. Populated by the system. Read-only.", + "uid": "UID is the unique in time and space value for this object. It is typically generated by the server on successful creation of a resource and is not allowed to change on PUT operations.\n\nPopulated by the system. Read-only. More info: http://kubernetes.io/docs/user-guide/identifiers#uids", + "resourceVersion": "An opaque value that represents the internal version of this object that can be used by clients to determine when objects have changed. May be used for optimistic concurrency, change detection, and the watch operation on a resource or set of resources. Clients must treat these values as opaque and passed unmodified back to the server. They may only be valid for a particular resource or set of resources.\n\nPopulated by the system. Read-only. Value must be treated as opaque by clients and . More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#concurrency-control-and-consistency", + "generation": "A sequence number representing a specific generation of the desired state. Populated by the system. Read-only.", + "creationTimestamp": "CreationTimestamp is a timestamp representing the server time when this object was created. It is not guaranteed to be set in happens-before order across separate operations. Clients may not set this value. It is represented in RFC3339 form and is in UTC.\n\nPopulated by the system. Read-only. Null for lists. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "deletionTimestamp": "DeletionTimestamp is RFC 3339 date and time at which this resource will be deleted. This field is set by the server when a graceful deletion is requested by the user, and is not directly settable by a client. The resource is expected to be deleted (no longer visible from resource lists, and not reachable by name) after the time in this field. Once set, this value may not be unset or be set further into the future, although it may be shortened or the resource may be deleted prior to this time. For example, a user may request that a pod is deleted in 30 seconds. The Kubelet will react by sending a graceful termination signal to the containers in the pod. After that 30 seconds, the Kubelet will send a hard termination signal (SIGKILL) to the container and after cleanup, remove the pod from the API. In the presence of network partitions, this object may still exist after this timestamp, until an administrator or automated process can determine the resource is fully terminated. If not set, graceful deletion of the object has not been requested.\n\nPopulated by the system when a graceful deletion is requested. Read-only. More info: http://releases.k8s.io/HEAD/docs/devel/api-conventions.md#metadata", + "deletionGracePeriodSeconds": "Number of seconds allowed for this object to gracefully terminate before it will be removed from the system. Only set when deletionTimestamp is also set. May only be shortened. Read-only.", + "labels": "Map of string keys and values that can be used to organize and categorize (scope and select) objects. May match selectors of replication controllers and services. More info: http://kubernetes.io/docs/user-guide/labels", + "annotations": "Annotations is an unstructured key value map stored with a resource that may be set by external tools to store and retrieve arbitrary metadata. They are not queryable and should be preserved when modifying objects. More info: http://kubernetes.io/docs/user-guide/annotations", + "ownerReferences": "List of objects depended by this object. If ALL objects in the list have been deleted, this object will be garbage collected. If this object is managed by a controller, then an entry in this list will point to this controller, with the controller field set to true. There cannot be more than one managing controller.", + "finalizers": "Must be empty before the object is deleted from the registry. Each entry is an identifier for the responsible component that will remove the entry from the list. If the deletionTimestamp of the object is non-nil, entries in this list can only be removed.", + "clusterName": "The name of the cluster which the object belongs to. This is used to distinguish resources with same name and namespace in different clusters. This field is not set anywhere right now and apiserver is going to ignore it if set in create or update request.", +} + +func (ObjectMeta) SwaggerDoc() map[string]string { + return map_ObjectMeta +} + var map_OwnerReference = map[string]string{ "": "OwnerReference contains enough information to let you identify an owning object. Currently, an owning object must be in the same namespace, so there is no namespace field.", "apiVersion": "API version of the referent.", diff --git a/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/types/patch.go b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/types/patch.go new file mode 100644 index 00000000000..d522d1dbdc6 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/types/patch.go @@ -0,0 +1,28 @@ +/* +Copyright 2015 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package types + +// Similarly to above, these are constants to support HTTP PATCH utilized by +// both the client and server that didn't make sense for a whole package to be +// dedicated to. +type PatchType string + +const ( + JSONPatchType PatchType = "application/json-patch+json" + MergePatchType PatchType = "application/merge-patch+json" + StrategicMergePatchType PatchType = "application/strategic-merge-patch+json" +) diff --git a/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/version/doc.go b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/version/doc.go new file mode 100644 index 00000000000..afbab6ab33b --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/version/doc.go @@ -0,0 +1,18 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +// Package version supplies the type for version information collected at build time. +package version diff --git a/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/version/types.go b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/version/types.go new file mode 100644 index 00000000000..72727b503b7 --- /dev/null +++ b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/version/types.go @@ -0,0 +1,37 @@ +/* +Copyright 2014 The Kubernetes Authors. + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +package version + +// Info contains versioning information. +// TODO: Add []string of api versions supported? It's still unclear +// how we'll want to distribute that information. +type Info struct { + Major string `json:"major"` + Minor string `json:"minor"` + GitVersion string `json:"gitVersion"` + GitCommit string `json:"gitCommit"` + GitTreeState string `json:"gitTreeState"` + BuildDate string `json:"buildDate"` + GoVersion string `json:"goVersion"` + Compiler string `json:"compiler"` + Platform string `json:"platform"` +} + +// String returns info as a human-friendly version string. +func (info Info) String() string { + return info.GitVersion +} diff --git a/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/reflect/deep_equal.go b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/deep_equal.go similarity index 100% rename from staging/src/k8s.io/client-go/pkg/third_party/forked/golang/reflect/deep_equal.go rename to staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/deep_equal.go diff --git a/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/reflect/type.go b/staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/type.go similarity index 100% rename from staging/src/k8s.io/client-go/pkg/third_party/forked/golang/reflect/type.go rename to staging/src/k8s.io/client-go/_vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/type.go diff --git a/staging/src/k8s.io/client-go/discovery/discovery_client.go b/staging/src/k8s.io/client-go/discovery/discovery_client.go index 5240224f78c..8031ce21226 100644 --- a/staging/src/k8s.io/client-go/discovery/discovery_client.go +++ b/staging/src/k8s.io/client-go/discovery/discovery_client.go @@ -30,9 +30,9 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api/v1" - "k8s.io/client-go/pkg/version" "k8s.io/client-go/rest" ) diff --git a/staging/src/k8s.io/client-go/discovery/discovery_client_test.go b/staging/src/k8s.io/client-go/discovery/discovery_client_test.go index 0c2f31b1084..e1350615808 100644 --- a/staging/src/k8s.io/client-go/discovery/discovery_client_test.go +++ b/staging/src/k8s.io/client-go/discovery/discovery_client_test.go @@ -28,8 +28,8 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/util/sets" + "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/pkg/api/v1" - "k8s.io/client-go/pkg/version" "k8s.io/client-go/rest" ) diff --git a/staging/src/k8s.io/client-go/discovery/fake/discovery.go b/staging/src/k8s.io/client-go/discovery/fake/discovery.go index c1f6268d6e1..534fa23ede7 100644 --- a/staging/src/k8s.io/client-go/discovery/fake/discovery.go +++ b/staging/src/k8s.io/client-go/discovery/fake/discovery.go @@ -23,8 +23,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/pkg/api/v1" - "k8s.io/client-go/pkg/version" + kubeversion "k8s.io/client-go/pkg/version" "k8s.io/client-go/rest" "k8s.io/client-go/testing" ) @@ -74,7 +75,7 @@ func (c *FakeDiscovery) ServerVersion() (*version.Info, error) { action.Resource = schema.GroupVersionResource{Resource: "version"} c.Invokes(action, nil) - versionInfo := version.Get() + versionInfo := kubeversion.Get() return &versionInfo, nil } diff --git a/staging/src/k8s.io/client-go/discovery/restmapper_test.go b/staging/src/k8s.io/client-go/discovery/restmapper_test.go index 590c26a8cb6..deb619e1772 100644 --- a/staging/src/k8s.io/client-go/discovery/restmapper_test.go +++ b/staging/src/k8s.io/client-go/discovery/restmapper_test.go @@ -23,8 +23,8 @@ import ( "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/version" "k8s.io/client-go/pkg/api" - "k8s.io/client-go/pkg/version" "k8s.io/client-go/rest" "k8s.io/client-go/rest/fake" diff --git a/staging/src/k8s.io/client-go/dynamic/client.go b/staging/src/k8s.io/client-go/dynamic/client.go index 744570ea148..bf3929ed20e 100644 --- a/staging/src/k8s.io/client-go/dynamic/client.go +++ b/staging/src/k8s.io/client-go/dynamic/client.go @@ -32,6 +32,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer" + "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" "k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api/v1" @@ -204,7 +205,7 @@ func (rc *ResourceClient) Watch(opts runtime.Object) (watch.Interface, error) { Watch() } -func (rc *ResourceClient) Patch(name string, pt api.PatchType, data []byte) (*unstructured.Unstructured, error) { +func (rc *ResourceClient) Patch(name string, pt types.PatchType, data []byte) (*unstructured.Unstructured, error) { result := new(unstructured.Unstructured) err := rc.cl.Patch(pt). NamespaceIfScoped(rc.ns, rc.resource.Namespaced). diff --git a/staging/src/k8s.io/client-go/dynamic/client_test.go b/staging/src/k8s.io/client-go/dynamic/client_test.go index 3335b6be59d..3499e43ea45 100644 --- a/staging/src/k8s.io/client-go/dynamic/client_test.go +++ b/staging/src/k8s.io/client-go/dynamic/client_test.go @@ -30,8 +30,8 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/runtime/serializer/streaming" + "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/rest" restclientwatch "k8s.io/client-go/rest/watch" @@ -520,8 +520,8 @@ func TestPatch(t *testing.T) { } content := r.Header.Get("Content-Type") - if content != string(api.StrategicMergePatchType) { - t.Errorf("Patch(%q) got Content-Type %s. wanted %s", tc.name, content, api.StrategicMergePatchType) + if content != string(types.StrategicMergePatchType) { + t.Errorf("Patch(%q) got Content-Type %s. wanted %s", tc.name, content, types.StrategicMergePatchType) } data, err := ioutil.ReadAll(r.Body) @@ -540,7 +540,7 @@ func TestPatch(t *testing.T) { } defer srv.Close() - got, err := cl.Resource(resource, tc.namespace).Patch(tc.name, api.StrategicMergePatchType, tc.patch) + got, err := cl.Resource(resource, tc.namespace).Patch(tc.name, types.StrategicMergePatchType, tc.patch) if err != nil { t.Errorf("unexpected error when patching %q: %v", tc.name, err) continue diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go index 27538078314..d6607c13ed2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/fake/fake_statefulset.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1beta1 "k8s.io/client-go/pkg/apis/apps/v1beta1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakeStatefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched statefulSet. -func (c *FakeStatefulSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) { +func (c *FakeStatefulSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(statefulsetsResource, c.ns, name, data, subresources...), &v1beta1.StatefulSet{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go index cfb30fa7691..e44c24701e7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/apps/v1beta1/statefulset.go @@ -18,6 +18,7 @@ package v1beta1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type StatefulSetInterface interface { Get(name string, options meta_v1.GetOptions) (*v1beta1.StatefulSet, error) List(opts v1.ListOptions) (*v1beta1.StatefulSetList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) StatefulSetExpansion } @@ -158,7 +159,7 @@ func (c *statefulSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched statefulSet. -func (c *statefulSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) { +func (c *statefulSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StatefulSet, err error) { result = &v1beta1.StatefulSet{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go index 0663ac0b584..d50968d9802 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/fake/fake_horizontalpodautoscaler.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" api_v1 "k8s.io/client-go/pkg/api/v1" v1 "k8s.io/client-go/pkg/apis/autoscaling/v1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakeHorizontalPodAutoscalers) Watch(opts api_v1.ListOptions) (watch.Int } // Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *FakeHorizontalPodAutoscalers) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { +func (c *FakeHorizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(horizontalpodautoscalersResource, c.ns, name, data, subresources...), &v1.HorizontalPodAutoscaler{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go index 007613f4ff4..fe0cb8d1c56 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/autoscaling/v1/horizontalpodautoscaler.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" api_v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type HorizontalPodAutoscalerInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.HorizontalPodAutoscaler, error) List(opts api_v1.ListOptions) (*v1.HorizontalPodAutoscalerList, error) Watch(opts api_v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) HorizontalPodAutoscalerExpansion } @@ -158,7 +159,7 @@ func (c *horizontalPodAutoscalers) Watch(opts api_v1.ListOptions) (watch.Interfa } // Patch applies the patch and returns the patched horizontalPodAutoscaler. -func (c *horizontalPodAutoscalers) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { +func (c *horizontalPodAutoscalers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.HorizontalPodAutoscaler, err error) { result = &v1.HorizontalPodAutoscaler{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go index d9d94555bea..a04cdebd5c7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/fake/fake_job.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" api_v1 "k8s.io/client-go/pkg/api/v1" v1 "k8s.io/client-go/pkg/apis/batch/v1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakeJobs) Watch(opts api_v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched job. -func (c *FakeJobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) { +func (c *FakeJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &v1.Job{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go index e141bf62028..80f37dc4760 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v1/job.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" api_v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type JobInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.Job, error) List(opts api_v1.ListOptions) (*v1.JobList, error) Watch(opts api_v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) JobExpansion } @@ -158,7 +159,7 @@ func (c *jobs) Watch(opts api_v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched job. -func (c *jobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) { +func (c *jobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Job, err error) { result = &v1.Job{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go index 7dc78957037..d13d374346c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/cronjob.go @@ -18,6 +18,7 @@ package v2alpha1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type CronJobInterface interface { Get(name string, options meta_v1.GetOptions) (*v2alpha1.CronJob, error) List(opts v1.ListOptions) (*v2alpha1.CronJobList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) CronJobExpansion } @@ -158,7 +159,7 @@ func (c *cronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched cronJob. -func (c *cronJobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) { +func (c *cronJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) { result = &v2alpha1.CronJob{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go index 1c8d89c7c8a..9aed24a55cb 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_cronjob.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v2alpha1 "k8s.io/client-go/pkg/apis/batch/v2alpha1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakeCronJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched cronJob. -func (c *FakeCronJobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) { +func (c *FakeCronJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.CronJob, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(cronjobsResource, c.ns, name, data, subresources...), &v2alpha1.CronJob{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go index fe089aa6876..e96c2cb76ef 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/fake/fake_job.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v2alpha1 "k8s.io/client-go/pkg/apis/batch/v2alpha1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakeJobs) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched job. -func (c *FakeJobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) { +func (c *FakeJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(jobsResource, c.ns, name, data, subresources...), &v2alpha1.Job{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go index 8bcef77f11b..6f23ff5d35d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/batch/v2alpha1/job.go @@ -18,6 +18,7 @@ package v2alpha1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type JobInterface interface { Get(name string, options meta_v1.GetOptions) (*v2alpha1.Job, error) List(opts v1.ListOptions) (*v2alpha1.JobList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) JobExpansion } @@ -158,7 +159,7 @@ func (c *jobs) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched job. -func (c *jobs) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) { +func (c *jobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v2alpha1.Job, err error) { result = &v2alpha1.Job{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest.go index 885a247a534..a25662da284 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/certificatesigningrequest.go @@ -18,6 +18,7 @@ package v1alpha1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type CertificateSigningRequestInterface interface { Get(name string, options meta_v1.GetOptions) (*v1alpha1.CertificateSigningRequest, error) List(opts v1.ListOptions) (*v1alpha1.CertificateSigningRequestList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.CertificateSigningRequest, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CertificateSigningRequest, err error) CertificateSigningRequestExpansion } @@ -148,7 +149,7 @@ func (c *certificateSigningRequests) Watch(opts v1.ListOptions) (watch.Interface } // Patch applies the patch and returns the patched certificateSigningRequest. -func (c *certificateSigningRequests) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.CertificateSigningRequest, err error) { +func (c *certificateSigningRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CertificateSigningRequest, err error) { result = &v1alpha1.CertificateSigningRequest{} err = c.client.Patch(pt). Resource("certificatesigningrequests"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest.go b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest.go index 248d84e6af2..ff98b93016e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/certificates/v1alpha1/fake/fake_certificatesigningrequest.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1alpha1 "k8s.io/client-go/pkg/apis/certificates/v1alpha1" testing "k8s.io/client-go/testing" @@ -110,7 +110,7 @@ func (c *FakeCertificateSigningRequests) Watch(opts v1.ListOptions) (watch.Inter } // Patch applies the patch and returns the patched certificateSigningRequest. -func (c *FakeCertificateSigningRequests) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.CertificateSigningRequest, err error) { +func (c *FakeCertificateSigningRequests) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.CertificateSigningRequest, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(certificatesigningrequestsResource, name, data, subresources...), &v1alpha1.CertificateSigningRequest{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go index 59f472bbbde..a30605907db 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/componentstatus.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -39,7 +40,7 @@ type ComponentStatusInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.ComponentStatus, error) List(opts v1.ListOptions) (*v1.ComponentStatusList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ComponentStatus, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ComponentStatus, err error) ComponentStatusExpansion } @@ -131,7 +132,7 @@ func (c *componentStatuses) Watch(opts v1.ListOptions) (watch.Interface, error) } // Patch applies the patch and returns the patched componentStatus. -func (c *componentStatuses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ComponentStatus, err error) { +func (c *componentStatuses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ComponentStatus, err error) { result = &v1.ComponentStatus{} err = c.client.Patch(pt). Resource("componentstatuses"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go index c6d849eb9de..645c1a5f910 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/configmap.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -39,7 +40,7 @@ type ConfigMapInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.ConfigMap, error) List(opts v1.ListOptions) (*v1.ConfigMapList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) ConfigMapExpansion } @@ -140,7 +141,7 @@ func (c *configMaps) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched configMap. -func (c *configMaps) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) { +func (c *configMaps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) { result = &v1.ConfigMap{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go index d0985b28ba9..04bc08bf522 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/endpoints.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -39,7 +40,7 @@ type EndpointsInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.Endpoints, error) List(opts v1.ListOptions) (*v1.EndpointsList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Endpoints, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Endpoints, err error) EndpointsExpansion } @@ -140,7 +141,7 @@ func (c *endpoints) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched endpoints. -func (c *endpoints) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Endpoints, err error) { +func (c *endpoints) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Endpoints, err error) { result = &v1.Endpoints{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go index 5623f1991a2..daf3949ff2f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -39,7 +40,7 @@ type EventInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.Event, error) List(opts v1.ListOptions) (*v1.EventList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) EventExpansion } @@ -140,7 +141,7 @@ func (c *events) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched event. -func (c *events) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) { +func (c *events) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) { result = &v1.Event{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go index 20aee7ac684..15930844ee6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/event_expansion.go @@ -20,6 +20,7 @@ import ( "fmt" "k8s.io/apimachinery/pkg/runtime" + "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api/v1" "k8s.io/client-go/pkg/fields" @@ -84,7 +85,7 @@ func (e *events) PatchWithEventNamespace(incompleteEvent *v1.Event, data []byte) return nil, fmt.Errorf("can't patch an event with namespace '%v' in namespace '%v'", incompleteEvent.Namespace, e.ns) } result := &v1.Event{} - err := e.client.Patch(api.StrategicMergePatchType). + err := e.client.Patch(types.StrategicMergePatchType). NamespaceIfScoped(incompleteEvent.Namespace, len(incompleteEvent.Namespace) > 0). Resource("events"). Name(incompleteEvent.Name). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go index dc3a7ba7ec9..3a8e3552cec 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_componentstatus.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -100,7 +100,7 @@ func (c *FakeComponentStatuses) Watch(opts v1.ListOptions) (watch.Interface, err } // Patch applies the patch and returns the patched componentStatus. -func (c *FakeComponentStatuses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ComponentStatus, err error) { +func (c *FakeComponentStatuses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ComponentStatus, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(componentstatusesResource, name, data, subresources...), &v1.ComponentStatus{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go index 1e29875ca97..9f136833ef3 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_configmap.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -107,7 +107,7 @@ func (c *FakeConfigMaps) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched configMap. -func (c *FakeConfigMaps) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) { +func (c *FakeConfigMaps) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ConfigMap, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(configmapsResource, c.ns, name, data, subresources...), &v1.ConfigMap{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go index 7858e97c9b4..a03b6a74f8d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_endpoints.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -107,7 +107,7 @@ func (c *FakeEndpoints) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched endpoints. -func (c *FakeEndpoints) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Endpoints, err error) { +func (c *FakeEndpoints) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Endpoints, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(endpointsResource, c.ns, name, data, subresources...), &v1.Endpoints{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go index bc24a611487..4f344b3b76e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_event.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -107,7 +107,7 @@ func (c *FakeEvents) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched event. -func (c *FakeEvents) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) { +func (c *FakeEvents) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Event, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(eventsResource, c.ns, name, data, subresources...), &v1.Event{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go index 6a3ea3e7cca..70ebb2885c5 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_limitrange.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -107,7 +107,7 @@ func (c *FakeLimitRanges) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched limitRange. -func (c *FakeLimitRanges) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.LimitRange, err error) { +func (c *FakeLimitRanges) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.LimitRange, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(limitrangesResource, c.ns, name, data, subresources...), &v1.LimitRange{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go index ae756dedcc9..121871b3337 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_namespace.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -109,7 +109,7 @@ func (c *FakeNamespaces) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched namespace. -func (c *FakeNamespaces) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) { +func (c *FakeNamespaces) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(namespacesResource, name, data, subresources...), &v1.Namespace{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go index 891d1e9abc9..4e7cbe8c4f8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_node.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -109,7 +109,7 @@ func (c *FakeNodes) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched node. -func (c *FakeNodes) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Node, err error) { +func (c *FakeNodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Node, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(nodesResource, name, data, subresources...), &v1.Node{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go index 2fb7a51b56b..51d3cc6d073 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolume.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -109,7 +109,7 @@ func (c *FakePersistentVolumes) Watch(opts v1.ListOptions) (watch.Interface, err } // Patch applies the patch and returns the patched persistentVolume. -func (c *FakePersistentVolumes) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolume, err error) { +func (c *FakePersistentVolumes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolume, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(persistentvolumesResource, name, data, subresources...), &v1.PersistentVolume{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go index 1c17171e163..c7c1d24fc22 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_persistentvolumeclaim.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -117,7 +117,7 @@ func (c *FakePersistentVolumeClaims) Watch(opts v1.ListOptions) (watch.Interface } // Patch applies the patch and returns the patched persistentVolumeClaim. -func (c *FakePersistentVolumeClaims) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { +func (c *FakePersistentVolumeClaims) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(persistentvolumeclaimsResource, c.ns, name, data, subresources...), &v1.PersistentVolumeClaim{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go index 7ba33a2f092..19eda326290 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_pod.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -117,7 +117,7 @@ func (c *FakePods) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched pod. -func (c *FakePods) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) { +func (c *FakePods) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(podsResource, c.ns, name, data, subresources...), &v1.Pod{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go index 1669d1734c4..e652d2b51f8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_podtemplate.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -107,7 +107,7 @@ func (c *FakePodTemplates) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched podTemplate. -func (c *FakePodTemplates) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PodTemplate, err error) { +func (c *FakePodTemplates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodTemplate, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(podtemplatesResource, c.ns, name, data, subresources...), &v1.PodTemplate{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go index 94c19de068b..276b606bb11 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_replicationcontroller.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -117,7 +117,7 @@ func (c *FakeReplicationControllers) Watch(opts v1.ListOptions) (watch.Interface } // Patch applies the patch and returns the patched replicationController. -func (c *FakeReplicationControllers) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) { +func (c *FakeReplicationControllers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(replicationcontrollersResource, c.ns, name, data, subresources...), &v1.ReplicationController{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go index 01ce9808332..8e409f5d850 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_resourcequota.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -117,7 +117,7 @@ func (c *FakeResourceQuotas) Watch(opts v1.ListOptions) (watch.Interface, error) } // Patch applies the patch and returns the patched resourceQuota. -func (c *FakeResourceQuotas) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) { +func (c *FakeResourceQuotas) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(resourcequotasResource, c.ns, name, data, subresources...), &v1.ResourceQuota{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go index 59b86a75af8..6b64414ff56 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_secret.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -107,7 +107,7 @@ func (c *FakeSecrets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched secret. -func (c *FakeSecrets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) { +func (c *FakeSecrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(secretsResource, c.ns, name, data, subresources...), &v1.Secret{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go index 7bff637a272..b9d3ce72122 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_service.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -117,7 +117,7 @@ func (c *FakeServices) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched service. -func (c *FakeServices) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) { +func (c *FakeServices) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(servicesResource, c.ns, name, data, subresources...), &v1.Service{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go index ddbdb1dd721..409b468e784 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/fake/fake_serviceaccount.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" testing "k8s.io/client-go/testing" ) @@ -107,7 +107,7 @@ func (c *FakeServiceAccounts) Watch(opts v1.ListOptions) (watch.Interface, error } // Patch applies the patch and returns the patched serviceAccount. -func (c *FakeServiceAccounts) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ServiceAccount, err error) { +func (c *FakeServiceAccounts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceAccount, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(serviceaccountsResource, c.ns, name, data, subresources...), &v1.ServiceAccount{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go index d7470a6a08a..97f75a1e6ab 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/limitrange.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -39,7 +40,7 @@ type LimitRangeInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.LimitRange, error) List(opts v1.ListOptions) (*v1.LimitRangeList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.LimitRange, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.LimitRange, err error) LimitRangeExpansion } @@ -140,7 +141,7 @@ func (c *limitRanges) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched limitRange. -func (c *limitRanges) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.LimitRange, err error) { +func (c *limitRanges) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.LimitRange, err error) { result = &v1.LimitRange{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go index 6c87008f15f..f597f2d0eb4 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/namespace.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type NamespaceInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.Namespace, error) List(opts v1.ListOptions) (*v1.NamespaceList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) NamespaceExpansion } @@ -147,7 +148,7 @@ func (c *namespaces) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched namespace. -func (c *namespaces) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) { +func (c *namespaces) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Namespace, err error) { result = &v1.Namespace{} err = c.client.Patch(pt). Resource("namespaces"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go index d6531f7db69..8102306433a 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type NodeInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.Node, error) List(opts v1.ListOptions) (*v1.NodeList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Node, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Node, err error) NodeExpansion } @@ -147,7 +148,7 @@ func (c *nodes) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched node. -func (c *nodes) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Node, err error) { +func (c *nodes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Node, err error) { result = &v1.Node{} err = c.client.Patch(pt). Resource("nodes"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go index 748b8c6afb1..29c12aabcdb 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/node_expansion.go @@ -17,7 +17,7 @@ limitations under the License. package v1 import ( - "k8s.io/client-go/pkg/api" + "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/pkg/api/v1" ) @@ -32,7 +32,7 @@ type NodeExpansion interface { // the node that the server returns, or an error. func (c *nodes) PatchStatus(nodeName string, data []byte) (*v1.Node, error) { result := &v1.Node{} - err := c.client.Patch(api.StrategicMergePatchType). + err := c.client.Patch(types.StrategicMergePatchType). Resource("nodes"). Name(nodeName). SubResource("status"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go index 30941d523df..7650d3b1901 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolume.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type PersistentVolumeInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.PersistentVolume, error) List(opts v1.ListOptions) (*v1.PersistentVolumeList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolume, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolume, err error) PersistentVolumeExpansion } @@ -147,7 +148,7 @@ func (c *persistentVolumes) Watch(opts v1.ListOptions) (watch.Interface, error) } // Patch applies the patch and returns the patched persistentVolume. -func (c *persistentVolumes) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolume, err error) { +func (c *persistentVolumes) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolume, err error) { result = &v1.PersistentVolume{} err = c.client.Patch(pt). Resource("persistentvolumes"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go index b9046e6ff0b..79f3dc839f8 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/persistentvolumeclaim.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type PersistentVolumeClaimInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.PersistentVolumeClaim, error) List(opts v1.ListOptions) (*v1.PersistentVolumeClaimList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error) PersistentVolumeClaimExpansion } @@ -157,7 +158,7 @@ func (c *persistentVolumeClaims) Watch(opts v1.ListOptions) (watch.Interface, er } // Patch applies the patch and returns the patched persistentVolumeClaim. -func (c *persistentVolumeClaims) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { +func (c *persistentVolumeClaims) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PersistentVolumeClaim, err error) { result = &v1.PersistentVolumeClaim{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go index 75ae88b673c..7c5abcdcd8f 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/pod.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type PodInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.Pod, error) List(opts v1.ListOptions) (*v1.PodList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) PodExpansion } @@ -157,7 +158,7 @@ func (c *pods) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched pod. -func (c *pods) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) { +func (c *pods) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Pod, err error) { result = &v1.Pod{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go index ea34cdf8b54..c81cc998248 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/podtemplate.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -39,7 +40,7 @@ type PodTemplateInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.PodTemplate, error) List(opts v1.ListOptions) (*v1.PodTemplateList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PodTemplate, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodTemplate, err error) PodTemplateExpansion } @@ -140,7 +141,7 @@ func (c *podTemplates) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched podTemplate. -func (c *podTemplates) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.PodTemplate, err error) { +func (c *podTemplates) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.PodTemplate, err error) { result = &v1.PodTemplate{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go index 475181c11a4..ba44fd42a30 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/replicationcontroller.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type ReplicationControllerInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.ReplicationController, error) List(opts v1.ListOptions) (*v1.ReplicationControllerList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) ReplicationControllerExpansion } @@ -157,7 +158,7 @@ func (c *replicationControllers) Watch(opts v1.ListOptions) (watch.Interface, er } // Patch applies the patch and returns the patched replicationController. -func (c *replicationControllers) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) { +func (c *replicationControllers) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ReplicationController, err error) { result = &v1.ReplicationController{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go index 77401851de2..3dc3ae71e8a 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/resourcequota.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type ResourceQuotaInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.ResourceQuota, error) List(opts v1.ListOptions) (*v1.ResourceQuotaList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) ResourceQuotaExpansion } @@ -157,7 +158,7 @@ func (c *resourceQuotas) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched resourceQuota. -func (c *resourceQuotas) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) { +func (c *resourceQuotas) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ResourceQuota, err error) { result = &v1.ResourceQuota{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go index 685a89e2216..98d3d55d334 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/secret.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -39,7 +40,7 @@ type SecretInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.Secret, error) List(opts v1.ListOptions) (*v1.SecretList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) SecretExpansion } @@ -140,7 +141,7 @@ func (c *secrets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched secret. -func (c *secrets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) { +func (c *secrets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Secret, err error) { result = &v1.Secret{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go index 60a9edd6ecb..c9e7b4e9864 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/service.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type ServiceInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.Service, error) List(opts v1.ListOptions) (*v1.ServiceList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) ServiceExpansion } @@ -157,7 +158,7 @@ func (c *services) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched service. -func (c *services) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) { +func (c *services) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.Service, err error) { result = &v1.Service{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go index 00ce051eb95..88aa7a926aa 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/core/v1/serviceaccount.go @@ -18,6 +18,7 @@ package v1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -39,7 +40,7 @@ type ServiceAccountInterface interface { Get(name string, options meta_v1.GetOptions) (*v1.ServiceAccount, error) List(opts v1.ListOptions) (*v1.ServiceAccountList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ServiceAccount, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceAccount, err error) ServiceAccountExpansion } @@ -140,7 +141,7 @@ func (c *serviceAccounts) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched serviceAccount. -func (c *serviceAccounts) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1.ServiceAccount, err error) { +func (c *serviceAccounts) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1.ServiceAccount, err error) { result = &v1.ServiceAccount{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go index e15db628e05..adcd8e2cefa 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/daemonset.go @@ -18,6 +18,7 @@ package v1beta1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type DaemonSetInterface interface { Get(name string, options meta_v1.GetOptions) (*v1beta1.DaemonSet, error) List(opts v1.ListOptions) (*v1beta1.DaemonSetList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) DaemonSetExpansion } @@ -158,7 +159,7 @@ func (c *daemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched daemonSet. -func (c *daemonSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) { +func (c *daemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) { result = &v1beta1.DaemonSet{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go index ee3f3474b0c..07eba06d475 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/deployment.go @@ -18,6 +18,7 @@ package v1beta1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type DeploymentInterface interface { Get(name string, options meta_v1.GetOptions) (*v1beta1.Deployment, error) List(opts v1.ListOptions) (*v1beta1.DeploymentList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) DeploymentExpansion } @@ -158,7 +159,7 @@ func (c *deployments) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched deployment. -func (c *deployments) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) { +func (c *deployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) { result = &v1beta1.Deployment{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go index 4c048e8557e..9c07591fb0d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_daemonset.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakeDaemonSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched daemonSet. -func (c *FakeDaemonSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) { +func (c *FakeDaemonSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.DaemonSet, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(daemonsetsResource, c.ns, name, data, subresources...), &v1beta1.DaemonSet{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go index c93dc73a352..e91ab9f8651 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_deployment.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakeDeployments) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched deployment. -func (c *FakeDeployments) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) { +func (c *FakeDeployments) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Deployment, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(deploymentsResource, c.ns, name, data, subresources...), &v1beta1.Deployment{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go index 59843853bbc..5a70414c0e6 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_ingress.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakeIngresses) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched ingress. -func (c *FakeIngresses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) { +func (c *FakeIngresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(ingressesResource, c.ns, name, data, subresources...), &v1beta1.Ingress{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go index 1143585fdc4..30de81894d3 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_podsecuritypolicy.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1" testing "k8s.io/client-go/testing" @@ -101,7 +101,7 @@ func (c *FakePodSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, e } // Patch applies the patch and returns the patched podSecurityPolicy. -func (c *FakePodSecurityPolicies) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *FakePodSecurityPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(podsecuritypoliciesResource, name, data, subresources...), &v1beta1.PodSecurityPolicy{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go index 82c9e72a5bc..65121195263 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_replicaset.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakeReplicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched replicaSet. -func (c *FakeReplicaSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) { +func (c *FakeReplicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(replicasetsResource, c.ns, name, data, subresources...), &v1beta1.ReplicaSet{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go index e3e7ace18d6..b0d77f9502d 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/fake/fake_thirdpartyresource.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1beta1 "k8s.io/client-go/pkg/apis/extensions/v1beta1" testing "k8s.io/client-go/testing" @@ -101,7 +101,7 @@ func (c *FakeThirdPartyResources) Watch(opts v1.ListOptions) (watch.Interface, e } // Patch applies the patch and returns the patched thirdPartyResource. -func (c *FakeThirdPartyResources) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.ThirdPartyResource, err error) { +func (c *FakeThirdPartyResources) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ThirdPartyResource, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(thirdpartyresourcesResource, name, data, subresources...), &v1beta1.ThirdPartyResource{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go index e60e2b56b76..b75d0f96cc0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/ingress.go @@ -18,6 +18,7 @@ package v1beta1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type IngressInterface interface { Get(name string, options meta_v1.GetOptions) (*v1beta1.Ingress, error) List(opts v1.ListOptions) (*v1beta1.IngressList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) IngressExpansion } @@ -158,7 +159,7 @@ func (c *ingresses) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched ingress. -func (c *ingresses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) { +func (c *ingresses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.Ingress, err error) { result = &v1beta1.Ingress{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go index 2fcb1497f21..89c87b1aba0 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/podsecuritypolicy.go @@ -18,6 +18,7 @@ package v1beta1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type PodSecurityPolicyInterface interface { Get(name string, options meta_v1.GetOptions) (*v1beta1.PodSecurityPolicy, error) List(opts v1.ListOptions) (*v1beta1.PodSecurityPolicyList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) PodSecurityPolicyExpansion } @@ -132,7 +133,7 @@ func (c *podSecurityPolicies) Watch(opts v1.ListOptions) (watch.Interface, error } // Patch applies the patch and returns the patched podSecurityPolicy. -func (c *podSecurityPolicies) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { +func (c *podSecurityPolicies) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodSecurityPolicy, err error) { result = &v1beta1.PodSecurityPolicy{} err = c.client.Patch(pt). Resource("podsecuritypolicies"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go index 99ad92b6118..28522fc7356 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/replicaset.go @@ -18,6 +18,7 @@ package v1beta1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type ReplicaSetInterface interface { Get(name string, options meta_v1.GetOptions) (*v1beta1.ReplicaSet, error) List(opts v1.ListOptions) (*v1beta1.ReplicaSetList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) ReplicaSetExpansion } @@ -158,7 +159,7 @@ func (c *replicaSets) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched replicaSet. -func (c *replicaSets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) { +func (c *replicaSets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ReplicaSet, err error) { result = &v1beta1.ReplicaSet{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/thirdpartyresource.go b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/thirdpartyresource.go index 9fd61d8f5b6..09c8676e673 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/thirdpartyresource.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/extensions/v1beta1/thirdpartyresource.go @@ -18,6 +18,7 @@ package v1beta1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type ThirdPartyResourceInterface interface { Get(name string, options meta_v1.GetOptions) (*v1beta1.ThirdPartyResource, error) List(opts v1.ListOptions) (*v1beta1.ThirdPartyResourceList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.ThirdPartyResource, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ThirdPartyResource, err error) ThirdPartyResourceExpansion } @@ -132,7 +133,7 @@ func (c *thirdPartyResources) Watch(opts v1.ListOptions) (watch.Interface, error } // Patch applies the patch and returns the patched thirdPartyResource. -func (c *thirdPartyResources) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.ThirdPartyResource, err error) { +func (c *thirdPartyResources) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.ThirdPartyResource, err error) { result = &v1beta1.ThirdPartyResource{} err = c.client.Patch(pt). Resource("thirdpartyresources"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_poddisruptionbudget.go index f5be449c80c..e10dc904c32 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_poddisruptionbudget.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/fake/fake_poddisruptionbudget.go @@ -19,8 +19,8 @@ package fake import ( labels "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1alpha1 "k8s.io/client-go/pkg/apis/policy/v1alpha1" testing "k8s.io/client-go/testing" @@ -117,7 +117,7 @@ func (c *FakePodDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, } // Patch applies the patch and returns the patched podDisruptionBudget. -func (c *FakePodDisruptionBudgets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.PodDisruptionBudget, err error) { +func (c *FakePodDisruptionBudgets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PodDisruptionBudget, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, data, subresources...), &v1alpha1.PodDisruptionBudget{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/poddisruptionbudget.go index 883d715f305..f29ae41a906 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/poddisruptionbudget.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1alpha1/poddisruptionbudget.go @@ -17,6 +17,7 @@ limitations under the License. package v1alpha1 import ( + "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type PodDisruptionBudgetInterface interface { Get(name string) (*v1alpha1.PodDisruptionBudget, error) List(opts v1.ListOptions) (*v1alpha1.PodDisruptionBudgetList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.PodDisruptionBudget, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PodDisruptionBudget, err error) PodDisruptionBudgetExpansion } @@ -153,7 +154,7 @@ func (c *podDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, erro } // Patch applies the patch and returns the patched podDisruptionBudget. -func (c *podDisruptionBudgets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.PodDisruptionBudget, err error) { +func (c *podDisruptionBudgets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.PodDisruptionBudget, err error) { result = &v1alpha1.PodDisruptionBudget{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go index ca878633d27..937ca128c06 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/fake/fake_poddisruptionbudget.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1beta1 "k8s.io/client-go/pkg/apis/policy/v1beta1" testing "k8s.io/client-go/testing" @@ -118,7 +118,7 @@ func (c *FakePodDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, } // Patch applies the patch and returns the patched podDisruptionBudget. -func (c *FakePodDisruptionBudgets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { +func (c *FakePodDisruptionBudgets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(poddisruptionbudgetsResource, c.ns, name, data, subresources...), &v1beta1.PodDisruptionBudget{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go index 8232ba30559..ed391c252f2 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/policy/v1beta1/poddisruptionbudget.go @@ -18,6 +18,7 @@ package v1beta1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -41,7 +42,7 @@ type PodDisruptionBudgetInterface interface { Get(name string, options meta_v1.GetOptions) (*v1beta1.PodDisruptionBudget, error) List(opts v1.ListOptions) (*v1beta1.PodDisruptionBudgetList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) PodDisruptionBudgetExpansion } @@ -158,7 +159,7 @@ func (c *podDisruptionBudgets) Watch(opts v1.ListOptions) (watch.Interface, erro } // Patch applies the patch and returns the patched podDisruptionBudget. -func (c *podDisruptionBudgets) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { +func (c *podDisruptionBudgets) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.PodDisruptionBudget, err error) { result = &v1beta1.PodDisruptionBudget{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go index f9d4bc6f934..e1060beb549 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrole.go @@ -18,6 +18,7 @@ package v1alpha1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type ClusterRoleInterface interface { Get(name string, options meta_v1.GetOptions) (*v1alpha1.ClusterRole, error) List(opts v1.ListOptions) (*v1alpha1.ClusterRoleList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRole, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRole, err error) ClusterRoleExpansion } @@ -132,7 +133,7 @@ func (c *clusterRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched clusterRole. -func (c *clusterRoles) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRole, err error) { +func (c *clusterRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRole, err error) { result = &v1alpha1.ClusterRole{} err = c.client.Patch(pt). Resource("clusterroles"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go index a42cafcc12c..d267f19fa0c 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/clusterrolebinding.go @@ -18,6 +18,7 @@ package v1alpha1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type ClusterRoleBindingInterface interface { Get(name string, options meta_v1.GetOptions) (*v1alpha1.ClusterRoleBinding, error) List(opts v1.ListOptions) (*v1alpha1.ClusterRoleBindingList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) ClusterRoleBindingExpansion } @@ -132,7 +133,7 @@ func (c *clusterRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error } // Patch applies the patch and returns the patched clusterRoleBinding. -func (c *clusterRoleBindings) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { +func (c *clusterRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { result = &v1alpha1.ClusterRoleBinding{} err = c.client.Patch(pt). Resource("clusterrolebindings"). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go index 11fab803f76..f3d8ab5dcbd 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrole.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1alpha1 "k8s.io/client-go/pkg/apis/rbac/v1alpha1" testing "k8s.io/client-go/testing" @@ -101,7 +101,7 @@ func (c *FakeClusterRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched clusterRole. -func (c *FakeClusterRoles) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRole, err error) { +func (c *FakeClusterRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRole, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(clusterrolesResource, name, data, subresources...), &v1alpha1.ClusterRole{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go index 08f719f68b1..f493e6e185b 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_clusterrolebinding.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1alpha1 "k8s.io/client-go/pkg/apis/rbac/v1alpha1" testing "k8s.io/client-go/testing" @@ -101,7 +101,7 @@ func (c *FakeClusterRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, e } // Patch applies the patch and returns the patched clusterRoleBinding. -func (c *FakeClusterRoleBindings) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { +func (c *FakeClusterRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.ClusterRoleBinding, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(clusterrolebindingsResource, name, data, subresources...), &v1alpha1.ClusterRoleBinding{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go index 0be647238df..73d2158e1de 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_role.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1alpha1 "k8s.io/client-go/pkg/apis/rbac/v1alpha1" testing "k8s.io/client-go/testing" @@ -108,7 +108,7 @@ func (c *FakeRoles) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched role. -func (c *FakeRoles) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.Role, err error) { +func (c *FakeRoles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Role, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(rolesResource, c.ns, name, data, subresources...), &v1alpha1.Role{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go index c7c32386bd9..c3fe21f3baf 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/fake/fake_rolebinding.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1alpha1 "k8s.io/client-go/pkg/apis/rbac/v1alpha1" testing "k8s.io/client-go/testing" @@ -108,7 +108,7 @@ func (c *FakeRoleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched roleBinding. -func (c *FakeRoleBindings) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.RoleBinding, err error) { +func (c *FakeRoleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RoleBinding, err error) { obj, err := c.Fake. Invokes(testing.NewPatchSubresourceAction(rolebindingsResource, c.ns, name, data, subresources...), &v1alpha1.RoleBinding{}) diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go index 7ed5c195562..2525af94732 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/role.go @@ -18,6 +18,7 @@ package v1alpha1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type RoleInterface interface { Get(name string, options meta_v1.GetOptions) (*v1alpha1.Role, error) List(opts v1.ListOptions) (*v1alpha1.RoleList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.Role, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Role, err error) RoleExpansion } @@ -141,7 +142,7 @@ func (c *roles) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched role. -func (c *roles) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.Role, err error) { +func (c *roles) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.Role, err error) { result = &v1alpha1.Role{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go index 519806fe388..e620654f0a7 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/rbac/v1alpha1/rolebinding.go @@ -18,6 +18,7 @@ package v1alpha1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type RoleBindingInterface interface { Get(name string, options meta_v1.GetOptions) (*v1alpha1.RoleBinding, error) List(opts v1.ListOptions) (*v1alpha1.RoleBindingList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.RoleBinding, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RoleBinding, err error) RoleBindingExpansion } @@ -141,7 +142,7 @@ func (c *roleBindings) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched roleBinding. -func (c *roleBindings) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1alpha1.RoleBinding, err error) { +func (c *roleBindings) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1alpha1.RoleBinding, err error) { result = &v1alpha1.RoleBinding{} err = c.client.Patch(pt). Namespace(c.ns). diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go index d34197a2fa9..3e950b7510a 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/fake/fake_storageclass.go @@ -20,8 +20,8 @@ import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" labels "k8s.io/apimachinery/pkg/labels" schema "k8s.io/apimachinery/pkg/runtime/schema" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" - api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" v1beta1 "k8s.io/client-go/pkg/apis/storage/v1beta1" testing "k8s.io/client-go/testing" @@ -101,7 +101,7 @@ func (c *FakeStorageClasses) Watch(opts v1.ListOptions) (watch.Interface, error) } // Patch applies the patch and returns the patched storageClass. -func (c *FakeStorageClasses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) { +func (c *FakeStorageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) { obj, err := c.Fake. Invokes(testing.NewRootPatchSubresourceAction(storageclassesResource, name, data, subresources...), &v1beta1.StorageClass{}) if obj == nil { diff --git a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go index 49906a586fb..5a90373c86e 100644 --- a/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go +++ b/staging/src/k8s.io/client-go/kubernetes/typed/storage/v1beta1/storageclass.go @@ -18,6 +18,7 @@ package v1beta1 import ( meta_v1 "k8s.io/apimachinery/pkg/apis/meta/v1" + types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/client-go/pkg/api" v1 "k8s.io/client-go/pkg/api/v1" @@ -40,7 +41,7 @@ type StorageClassInterface interface { Get(name string, options meta_v1.GetOptions) (*v1beta1.StorageClass, error) List(opts v1.ListOptions) (*v1beta1.StorageClassList, error) Watch(opts v1.ListOptions) (watch.Interface, error) - Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) + Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) StorageClassExpansion } @@ -132,7 +133,7 @@ func (c *storageClasses) Watch(opts v1.ListOptions) (watch.Interface, error) { } // Patch applies the patch and returns the patched storageClass. -func (c *storageClasses) Patch(name string, pt api.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) { +func (c *storageClasses) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *v1beta1.StorageClass, err error) { result = &v1beta1.StorageClass{} err = c.client.Patch(pt). Resource("storageclasses"). diff --git a/staging/src/k8s.io/client-go/pkg/api/types.go b/staging/src/k8s.io/client-go/pkg/api/types.go index 5086f43e934..f815d469290 100644 --- a/staging/src/k8s.io/client-go/pkg/api/types.go +++ b/staging/src/k8s.io/client-go/pkg/api/types.go @@ -3422,17 +3422,6 @@ const ( PortForwardRequestIDHeader = "requestID" ) -// Similarly to above, these are constants to support HTTP PATCH utilized by -// both the client and server that didn't make sense for a whole package to be -// dedicated to. -type PatchType string - -const ( - JSONPatchType PatchType = "application/json-patch+json" - MergePatchType PatchType = "application/merge-patch+json" - StrategicMergePatchType PatchType = "application/strategic-merge-patch+json" -) - // Type and constants for component health validation. type ComponentConditionType string diff --git a/staging/src/k8s.io/client-go/pkg/api/v1/types.go b/staging/src/k8s.io/client-go/pkg/api/v1/types.go index 28a5661f0a7..ff9241dc916 100644 --- a/staging/src/k8s.io/client-go/pkg/api/v1/types.go +++ b/staging/src/k8s.io/client-go/pkg/api/v1/types.go @@ -120,7 +120,7 @@ type ObjectMeta struct { // Read-only. // More info: http://kubernetes.io/docs/user-guide/identifiers#uids // +optional - UID types.UID `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` + UID types.UID `json:"uid,omitempty" protobuf:"bytes,5,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` // An opaque value that represents the internal version of this object that can // be used by clients to determine when objects have changed. May be used for optimistic @@ -3241,7 +3241,7 @@ type Binding struct { type Preconditions struct { // Specifies the target UID. // +optional - UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` + UID *types.UID `json:"uid,omitempty" protobuf:"bytes,1,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` } // DeleteOptions may be provided when deleting an API object @@ -3454,7 +3454,7 @@ type ObjectReference struct { // UID of the referent. // More info: http://kubernetes.io/docs/user-guide/identifiers#uids // +optional - UID types.UID `json:"uid,omitempty" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/kubernetes/pkg/types.UID"` + UID types.UID `json:"uid,omitempty" protobuf:"bytes,4,opt,name=uid,casttype=k8s.io/apimachinery/pkg/types.UID"` // API version of the referent. // +optional APIVersion string `json:"apiVersion,omitempty" protobuf:"bytes,5,opt,name=apiVersion"` diff --git a/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/reflect/.readonly b/staging/src/k8s.io/client-go/pkg/third_party/forked/golang/reflect/.readonly deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/staging/src/k8s.io/client-go/pkg/util/config/feature_gate.go b/staging/src/k8s.io/client-go/pkg/util/config/feature_gate.go index ff90f2fb289..ea01833fbe9 100644 --- a/staging/src/k8s.io/client-go/pkg/util/config/feature_gate.go +++ b/staging/src/k8s.io/client-go/pkg/util/config/feature_gate.go @@ -61,7 +61,7 @@ var ( appArmor: {true, beta}, dynamicKubeletConfig: {false, alpha}, dynamicVolumeProvisioning: {true, alpha}, - streamingProxyRedirects: {false, alpha}, + streamingProxyRedirects: {true, beta}, experimentalHostUserNamespaceDefaultingGate: {false, alpha}, } diff --git a/staging/src/k8s.io/client-go/pkg/version/version.go b/staging/src/k8s.io/client-go/pkg/version/version.go index 0da3aadde07..8c8350d13b7 100644 --- a/staging/src/k8s.io/client-go/pkg/version/version.go +++ b/staging/src/k8s.io/client-go/pkg/version/version.go @@ -19,29 +19,16 @@ package version import ( "fmt" "runtime" -) -// Info contains versioning information. -// TODO: Add []string of api versions supported? It's still unclear -// how we'll want to distribute that information. -type Info struct { - Major string `json:"major"` - Minor string `json:"minor"` - GitVersion string `json:"gitVersion"` - GitCommit string `json:"gitCommit"` - GitTreeState string `json:"gitTreeState"` - BuildDate string `json:"buildDate"` - GoVersion string `json:"goVersion"` - Compiler string `json:"compiler"` - Platform string `json:"platform"` -} + apimachineryversion "k8s.io/apimachinery/pkg/version" +) // Get returns the overall codebase version. It's for detecting // what code a binary was built from. -func Get() Info { +func Get() apimachineryversion.Info { // These variables typically come from -ldflags settings and in // their absence fallback to the settings in pkg/version/base.go - return Info{ + return apimachineryversion.Info{ Major: gitMajor, Minor: gitMinor, GitVersion: gitVersion, @@ -53,8 +40,3 @@ func Get() Info { Platform: fmt.Sprintf("%s/%s", runtime.GOOS, runtime.GOARCH), } } - -// String returns info as a human-friendly version string. -func (info Info) String() string { - return info.GitVersion -} diff --git a/staging/src/k8s.io/client-go/rest/client.go b/staging/src/k8s.io/client-go/rest/client.go index b5325bf5bcf..92e7a422877 100644 --- a/staging/src/k8s.io/client-go/rest/client.go +++ b/staging/src/k8s.io/client-go/rest/client.go @@ -28,7 +28,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" - "k8s.io/client-go/pkg/api" + "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/pkg/util/flowcontrol" ) @@ -45,7 +45,7 @@ type Interface interface { Verb(verb string) *Request Post() *Request Put() *Request - Patch(pt api.PatchType) *Request + Patch(pt types.PatchType) *Request Get() *Request Delete() *Request APIVersion() schema.GroupVersion @@ -238,7 +238,7 @@ func (c *RESTClient) Put() *Request { } // Patch begins a PATCH request. Short for c.Verb("Patch"). -func (c *RESTClient) Patch(pt api.PatchType) *Request { +func (c *RESTClient) Patch(pt types.PatchType) *Request { return c.Verb("PATCH").SetHeader("Content-Type", string(pt)) } diff --git a/staging/src/k8s.io/client-go/rest/client_test.go b/staging/src/k8s.io/client-go/rest/client_test.go index 81783ced121..be961fc7ad6 100644 --- a/staging/src/k8s.io/client-go/rest/client_test.go +++ b/staging/src/k8s.io/client-go/rest/client_test.go @@ -31,6 +31,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/diff" "k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api/testapi" @@ -271,7 +272,7 @@ func TestHttpMethods(t *testing.T) { t.Errorf("Delete : Object returned should not be nil") } - request = c.Patch(api.JSONPatchType) + request = c.Patch(types.JSONPatchType) if request == nil { t.Errorf("Patch : Object returned should not be nil") } diff --git a/staging/src/k8s.io/client-go/rest/fake/fake.go b/staging/src/k8s.io/client-go/rest/fake/fake.go index 84f0478317c..7882006fe79 100644 --- a/staging/src/k8s.io/client-go/rest/fake/fake.go +++ b/staging/src/k8s.io/client-go/rest/fake/fake.go @@ -24,6 +24,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/types" "k8s.io/client-go/pkg/api" "k8s.io/client-go/pkg/api/testapi" "k8s.io/client-go/pkg/util/flowcontrol" @@ -61,7 +62,7 @@ func (c *RESTClient) Put() *rest.Request { return c.request("PUT") } -func (c *RESTClient) Patch(_ api.PatchType) *rest.Request { +func (c *RESTClient) Patch(_ types.PatchType) *rest.Request { return c.request("PATCH") } diff --git a/staging/src/k8s.io/client-go/testing/fake.go b/staging/src/k8s.io/client-go/testing/fake.go index e18814b3fd0..32a860f8e35 100644 --- a/staging/src/k8s.io/client-go/testing/fake.go +++ b/staging/src/k8s.io/client-go/testing/fake.go @@ -23,8 +23,9 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/runtime/schema" + "k8s.io/apimachinery/pkg/version" "k8s.io/apimachinery/pkg/watch" - "k8s.io/client-go/pkg/version" + kubeversion "k8s.io/client-go/pkg/version" "k8s.io/client-go/rest" ) @@ -253,6 +254,6 @@ func (c *FakeDiscovery) ServerVersion() (*version.Info, error) { action.Resource = schema.GroupVersionResource{Resource: "version"} c.Invokes(action, nil) - versionInfo := version.Get() + versionInfo := kubeversion.Get() return &versionInfo, nil } diff --git a/test/e2e/BUILD b/test/e2e/BUILD index 6dfbc020a3e..b096ea06deb 100644 --- a/test/e2e/BUILD +++ b/test/e2e/BUILD @@ -135,7 +135,6 @@ go_library( "//pkg/client/clientset_generated/clientset/typed/extensions/v1beta1:go_default_library", "//pkg/client/clientset_generated/internalclientset:go_default_library", "//pkg/client/restclient:go_default_library", - "//pkg/client/transport:go_default_library", "//pkg/client/unversioned/clientcmd:go_default_library", "//pkg/client/unversioned/clientcmd/api:go_default_library", "//pkg/cloudprovider:go_default_library", @@ -213,6 +212,7 @@ go_library( "//vendor:k8s.io/client-go/pkg/apis/extensions/v1beta1", "//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1", "//vendor:k8s.io/client-go/pkg/util/intstr", + "//vendor:k8s.io/client-go/transport", ], ) diff --git a/test/e2e/load.go b/test/e2e/load.go index b33f5787a84..4c6afc0ebb7 100644 --- a/test/e2e/load.go +++ b/test/e2e/load.go @@ -31,6 +31,7 @@ import ( "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/runtime/schema" utilnet "k8s.io/apimachinery/pkg/util/net" + "k8s.io/client-go/transport" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/v1" "k8s.io/kubernetes/pkg/apis/batch" @@ -38,7 +39,6 @@ import ( "k8s.io/kubernetes/pkg/client/clientset_generated/clientset" "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/restclient" - "k8s.io/kubernetes/pkg/client/transport" "k8s.io/kubernetes/pkg/util/intstr" "k8s.io/kubernetes/test/e2e/framework" testutils "k8s.io/kubernetes/test/utils" diff --git a/test/integration/auth/rbac_test.go b/test/integration/auth/rbac_test.go index 066919b551c..8c82542d2bd 100644 --- a/test/integration/auth/rbac_test.go +++ b/test/integration/auth/rbac_test.go @@ -36,12 +36,12 @@ import ( "k8s.io/apiserver/pkg/authentication/authenticator" "k8s.io/apiserver/pkg/authentication/request/bearertoken" "k8s.io/apiserver/pkg/authorization/authorizer" + "k8s.io/client-go/transport" "k8s.io/kubernetes/pkg/api" "k8s.io/kubernetes/pkg/api/testapi" rbacapi "k8s.io/kubernetes/pkg/apis/rbac" clientset "k8s.io/kubernetes/pkg/client/clientset_generated/internalclientset" "k8s.io/kubernetes/pkg/client/restclient" - "k8s.io/kubernetes/pkg/client/transport" "k8s.io/kubernetes/pkg/master" "k8s.io/kubernetes/pkg/registry/generic" "k8s.io/kubernetes/pkg/registry/rbac/clusterrole" diff --git a/vendor/BUILD b/vendor/BUILD index caea90fc95f..ec313f5ce28 100644 --- a/vendor/BUILD +++ b/vendor/BUILD @@ -10283,6 +10283,7 @@ go_library( "k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/types/doc.go", "k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/types/namespacedname.go", "k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/types/nodename.go", + "k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/types/patch.go", "k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/types/uid.go", "k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/types/unix_user_id.go", ], @@ -10432,9 +10433,9 @@ go_test( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/util/sets", + "//vendor:k8s.io/apimachinery/pkg/version", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", - "//vendor:k8s.io/client-go/pkg/version", "//vendor:k8s.io/client-go/rest", "//vendor:k8s.io/client-go/rest/fake", ], @@ -10459,6 +10460,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", "//vendor:k8s.io/apimachinery/pkg/util/sets", + "//vendor:k8s.io/apimachinery/pkg/version", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/version", @@ -10492,6 +10494,7 @@ go_library( "//vendor:github.com/emicklei/go-restful/swagger", "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/version", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/version", "//vendor:k8s.io/client-go/rest", @@ -10513,8 +10516,8 @@ go_test( "//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer/streaming", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/rest", "//vendor:k8s.io/client-go/rest/watch", @@ -10537,6 +10540,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -10641,6 +10645,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -10661,9 +10666,9 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/apps/v1beta1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/apps/v1beta1", "//vendor:k8s.io/client-go/rest", @@ -10765,6 +10770,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -10785,9 +10791,9 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/autoscaling/v1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/autoscaling/v1", "//vendor:k8s.io/client-go/rest", @@ -10808,6 +10814,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -10828,9 +10835,9 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/batch/v1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/batch/v1", "//vendor:k8s.io/client-go/rest", @@ -10852,6 +10859,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -10873,9 +10881,9 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/batch/v2alpha1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/batch/v2alpha1", "//vendor:k8s.io/client-go/rest", @@ -10897,6 +10905,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -10918,9 +10927,9 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/certificates/v1alpha1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/certificates/v1alpha1", "//vendor:k8s.io/client-go/rest", @@ -10962,6 +10971,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/util/net", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", @@ -11005,6 +11015,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/core/v1", "//vendor:k8s.io/client-go/pkg/api", @@ -11038,6 +11049,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -11066,9 +11078,9 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/extensions/v1beta1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/extensions/v1beta1", "//vendor:k8s.io/client-go/rest", @@ -11088,6 +11100,7 @@ go_library( deps = [ "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -11107,9 +11120,9 @@ go_library( deps = [ "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1alpha1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/policy/v1alpha1", "//vendor:k8s.io/client-go/rest", @@ -11132,6 +11145,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -11154,9 +11168,9 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/policy/v1beta1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/policy/v1beta1", "//vendor:k8s.io/client-go/rest", @@ -11180,6 +11194,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -11203,9 +11218,9 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/rbac/v1alpha1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/rbac/v1alpha1", "//vendor:k8s.io/client-go/rest", @@ -11226,6 +11241,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -11246,9 +11262,9 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/apis/meta/v1", "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/kubernetes/typed/storage/v1beta1", - "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", "//vendor:k8s.io/client-go/pkg/apis/storage/v1beta1", "//vendor:k8s.io/client-go/rest", @@ -12641,6 +12657,7 @@ go_library( "k8s.io/client-go/pkg/version/version.go", ], tags = ["automanaged"], + deps = ["//vendor:k8s.io/apimachinery/pkg/version"], ) go_library( @@ -12733,6 +12750,7 @@ go_test( "//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer/streaming", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/util/diff", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", @@ -12769,6 +12787,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", "//vendor:k8s.io/apimachinery/pkg/runtime/serializer/streaming", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/apimachinery/pkg/util/net", "//vendor:k8s.io/apimachinery/pkg/util/sets", "//vendor:k8s.io/apimachinery/pkg/watch", @@ -12793,6 +12812,7 @@ go_library( deps = [ "//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/types", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/testapi", "//vendor:k8s.io/client-go/pkg/util/flowcontrol", @@ -12849,6 +12869,7 @@ go_library( "//vendor:k8s.io/apimachinery/pkg/labels", "//vendor:k8s.io/apimachinery/pkg/runtime", "//vendor:k8s.io/apimachinery/pkg/runtime/schema", + "//vendor:k8s.io/apimachinery/pkg/version", "//vendor:k8s.io/apimachinery/pkg/watch", "//vendor:k8s.io/client-go/pkg/api", "//vendor:k8s.io/client-go/pkg/api/v1", @@ -13396,10 +13417,19 @@ go_library( ) go_library( - name = "k8s.io/client-go/pkg/third_party/forked/golang/reflect", + name = "k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/version", srcs = [ - "k8s.io/client-go/pkg/third_party/forked/golang/reflect/deep_equal.go", - "k8s.io/client-go/pkg/third_party/forked/golang/reflect/type.go", + "k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/version/doc.go", + "k8s.io/client-go/_vendor/k8s.io/apimachinery/pkg/version/types.go", + ], + tags = ["automanaged"], +) + +go_library( + name = "k8s.io/client-go/_vendor/k8s.io/apimachinery/third_party/forked/golang/reflect", + srcs = [ + "k8s.io/client-go/_vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/deep_equal.go", + "k8s.io/client-go/_vendor/k8s.io/apimachinery/third_party/forked/golang/reflect/type.go", ], tags = ["automanaged"], )