| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
package v2beta1 |
| 20 |
|
| 21 |
import ( |
| 22 |
http "net/http" |
| 23 |
|
| 24 |
autoscalingv2beta1 "k8s.io/api/autoscaling/v2beta1" |
| 25 |
scheme "k8s.io/client-go/kubernetes/scheme" |
| 26 |
rest "k8s.io/client-go/rest" |
| 27 |
) |
| 28 |
|
| 29 |
type AutoscalingV2beta1Interface interface { |
| 30 |
RESTClient() rest.Interface |
| 31 |
HorizontalPodAutoscalersGetter |
| 32 |
} |
| 33 |
|
| 34 |
|
| 35 |
type AutoscalingV2beta1Client struct { |
| 36 |
restClient rest.Interface |
| 37 |
} |
| 38 |
|
| 39 |
func (c *AutoscalingV2beta1Client) HorizontalPodAutoscalers(namespace string) HorizontalPodAutoscalerInterface { |
| 40 |
return newHorizontalPodAutoscalers(c, namespace) |
| 41 |
} |
| 42 |
|
| 43 |
|
| 44 |
|
| 45 |
|
| 46 |
func NewForConfig(c *rest.Config) (*AutoscalingV2beta1Client, error) { |
| 47 |
config := *c |
| 48 |
setConfigDefaults(&config) |
| 49 |
httpClient, err := rest.HTTPClientFor(&config) |
| 50 |
if err != nil { |
| 51 |
return nil, err |
| 52 |
} |
| 53 |
return NewForConfigAndClient(&config, httpClient) |
| 54 |
} |
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AutoscalingV2beta1Client, error) { |
| 59 |
config := *c |
| 60 |
setConfigDefaults(&config) |
| 61 |
client, err := rest.RESTClientForConfigAndClient(&config, h) |
| 62 |
if err != nil { |
| 63 |
return nil, err |
| 64 |
} |
| 65 |
return &AutoscalingV2beta1Client{client}, nil |
| 66 |
} |
| 67 |
|
| 68 |
|
| 69 |
|
| 70 |
func NewForConfigOrDie(c *rest.Config) *AutoscalingV2beta1Client { |
| 71 |
client, err := NewForConfig(c) |
| 72 |
if err != nil { |
| 73 |
panic(err) |
| 74 |
} |
| 75 |
return client |
| 76 |
} |
| 77 |
|
| 78 |
|
| 79 |
func New(c rest.Interface) *AutoscalingV2beta1Client { |
| 80 |
return &AutoscalingV2beta1Client{c} |
| 81 |
} |
| 82 |
|
| 83 |
func setConfigDefaults(config *rest.Config) { |
| 84 |
gv := autoscalingv2beta1.SchemeGroupVersion |
| 85 |
config.GroupVersion = &gv |
| 86 |
config.APIPath = "/apis" |
| 87 |
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() |
| 88 |
|
| 89 |
if config.UserAgent == "" { |
| 90 |
config.UserAgent = rest.DefaultKubernetesUserAgent() |
| 91 |
} |
| 92 |
} |
| 93 |
|
| 94 |
|
| 95 |
|
| 96 |
func (c *AutoscalingV2beta1Client) RESTClient() rest.Interface { |
| 97 |
if c == nil { |
| 98 |
return nil |
| 99 |
} |
| 100 |
return c.restClient |
| 101 |
} |