Update godeps
This commit is contained in:
parent
8b25cc67a5
commit
a736fba0e1
769 changed files with 15495 additions and 7996 deletions
38
vendor/k8s.io/kubernetes/pkg/client/restclient/config.go
generated
vendored
38
vendor/k8s.io/kubernetes/pkg/client/restclient/config.go
generated
vendored
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
Copyright 2016 The Kubernetes Authors All rights reserved.
|
||||
Copyright 2016 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.
|
||||
|
|
@ -37,6 +37,11 @@ import (
|
|||
"k8s.io/kubernetes/pkg/version"
|
||||
)
|
||||
|
||||
const (
|
||||
DefaultQPS float32 = 5.0
|
||||
DefaultBurst int = 10
|
||||
)
|
||||
|
||||
// Config holds the common attributes that can be passed to a Kubernetes client on
|
||||
// initialization.
|
||||
type Config struct {
|
||||
|
|
@ -93,10 +98,12 @@ type Config struct {
|
|||
// on top of the returned RoundTripper.
|
||||
WrapTransport func(rt http.RoundTripper) http.RoundTripper
|
||||
|
||||
// QPS indicates the maximum QPS to the master from this client. If zero, QPS is unlimited.
|
||||
// QPS indicates the maximum QPS to the master from this client.
|
||||
// If it's zero, the created RESTClient will use DefaultQPS: 5
|
||||
QPS float32
|
||||
|
||||
// Maximum burst for throttle
|
||||
// Maximum burst for throttle.
|
||||
// If it's zero, the created RESTClient will use DefaultBurst: 10.
|
||||
Burst int
|
||||
|
||||
// Rate limiter for limiting connections to the master from this client. If present overwrites QPS/Burst
|
||||
|
|
@ -136,15 +143,6 @@ type ContentConfig struct {
|
|||
// NegotiatedSerializer is used for obtaining encoders and decoders for multiple
|
||||
// supported media types.
|
||||
NegotiatedSerializer runtime.NegotiatedSerializer
|
||||
|
||||
// Codec specifies the encoding and decoding behavior for runtime.Objects passed
|
||||
// to a RESTClient or Client. Required when initializing a RESTClient, optional
|
||||
// when initializing a Client.
|
||||
//
|
||||
// DEPRECATED: Please use NegotiatedSerializer instead.
|
||||
// Codec is currently used only in some tests and will be removed soon.
|
||||
// All production setups should use NegotiatedSerializer.
|
||||
Codec runtime.Codec
|
||||
}
|
||||
|
||||
// RESTClientFor returns a RESTClient that satisfies the requested attributes on a client Config
|
||||
|
|
@ -158,6 +156,14 @@ func RESTClientFor(config *Config) (*RESTClient, error) {
|
|||
if config.NegotiatedSerializer == nil {
|
||||
return nil, fmt.Errorf("NegotiatedSerializer is required when initializing a RESTClient")
|
||||
}
|
||||
qps := config.QPS
|
||||
if config.QPS == 0.0 {
|
||||
qps = DefaultQPS
|
||||
}
|
||||
burst := config.Burst
|
||||
if config.Burst == 0 {
|
||||
burst = DefaultBurst
|
||||
}
|
||||
|
||||
baseURL, versionedAPIPath, err := defaultServerUrlFor(config)
|
||||
if err != nil {
|
||||
|
|
@ -174,7 +180,7 @@ func RESTClientFor(config *Config) (*RESTClient, error) {
|
|||
httpClient = &http.Client{Transport: transport}
|
||||
}
|
||||
|
||||
return NewRESTClient(baseURL, versionedAPIPath, config.ContentConfig, config.QPS, config.Burst, config.RateLimiter, httpClient)
|
||||
return NewRESTClient(baseURL, versionedAPIPath, config.ContentConfig, qps, burst, config.RateLimiter, httpClient)
|
||||
}
|
||||
|
||||
// UnversionedRESTClientFor is the same as RESTClientFor, except that it allows
|
||||
|
|
@ -214,12 +220,6 @@ func SetKubernetesDefaults(config *Config) error {
|
|||
if len(config.UserAgent) == 0 {
|
||||
config.UserAgent = DefaultKubernetesUserAgent()
|
||||
}
|
||||
if config.QPS == 0.0 {
|
||||
config.QPS = 5.0
|
||||
}
|
||||
if config.Burst == 0 {
|
||||
config.Burst = 10
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue