| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
|
| 16 |
|
| 17 |
|
| 18 |
|
| 19 |
package v1 |
| 20 |
|
| 21 |
import ( |
| 22 |
http "net/http" |
| 23 |
|
| 24 |
appsv1 "k8s.io/api/apps/v1" |
| 25 |
scheme "k8s.io/client-go/kubernetes/scheme" |
| 26 |
rest "k8s.io/client-go/rest" |
| 27 |
) |
| 28 |
|
| 29 |
type AppsV1Interface interface { |
| 30 |
RESTClient() rest.Interface |
| 31 |
ControllerRevisionsGetter |
| 32 |
DaemonSetsGetter |
| 33 |
DeploymentsGetter |
| 34 |
ReplicaSetsGetter |
| 35 |
StatefulSetsGetter |
| 36 |
} |
| 37 |
|
| 38 |
|
| 39 |
type AppsV1Client struct { |
| 40 |
restClient rest.Interface |
| 41 |
} |
| 42 |
|
| 43 |
func (c *AppsV1Client) ControllerRevisions(namespace string) ControllerRevisionInterface { |
| 44 |
return newControllerRevisions(c, namespace) |
| 45 |
} |
| 46 |
|
| 47 |
func (c *AppsV1Client) DaemonSets(namespace string) DaemonSetInterface { |
| 48 |
return newDaemonSets(c, namespace) |
| 49 |
} |
| 50 |
|
| 51 |
func (c *AppsV1Client) Deployments(namespace string) DeploymentInterface { |
| 52 |
return newDeployments(c, namespace) |
| 53 |
} |
| 54 |
|
| 55 |
func (c *AppsV1Client) ReplicaSets(namespace string) ReplicaSetInterface { |
| 56 |
return newReplicaSets(c, namespace) |
| 57 |
} |
| 58 |
|
| 59 |
func (c *AppsV1Client) StatefulSets(namespace string) StatefulSetInterface { |
| 60 |
return newStatefulSets(c, namespace) |
| 61 |
} |
| 62 |
|
| 63 |
|
| 64 |
|
| 65 |
|
| 66 |
func NewForConfig(c *rest.Config) (*AppsV1Client, error) { |
| 67 |
config := *c |
| 68 |
setConfigDefaults(&config) |
| 69 |
httpClient, err := rest.HTTPClientFor(&config) |
| 70 |
if err != nil { |
| 71 |
return nil, err |
| 72 |
} |
| 73 |
return NewForConfigAndClient(&config, httpClient) |
| 74 |
} |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
func NewForConfigAndClient(c *rest.Config, h *http.Client) (*AppsV1Client, error) { |
| 79 |
config := *c |
| 80 |
setConfigDefaults(&config) |
| 81 |
client, err := rest.RESTClientForConfigAndClient(&config, h) |
| 82 |
if err != nil { |
| 83 |
return nil, err |
| 84 |
} |
| 85 |
return &AppsV1Client{client}, nil |
| 86 |
} |
| 87 |
|
| 88 |
|
| 89 |
|
| 90 |
func NewForConfigOrDie(c *rest.Config) *AppsV1Client { |
| 91 |
client, err := NewForConfig(c) |
| 92 |
if err != nil { |
| 93 |
panic(err) |
| 94 |
} |
| 95 |
return client |
| 96 |
} |
| 97 |
|
| 98 |
|
| 99 |
func New(c rest.Interface) *AppsV1Client { |
| 100 |
return &AppsV1Client{c} |
| 101 |
} |
| 102 |
|
| 103 |
func setConfigDefaults(config *rest.Config) { |
| 104 |
gv := appsv1.SchemeGroupVersion |
| 105 |
config.GroupVersion = &gv |
| 106 |
config.APIPath = "/apis" |
| 107 |
config.NegotiatedSerializer = rest.CodecFactoryForGeneratedClient(scheme.Scheme, scheme.Codecs).WithoutConversion() |
| 108 |
|
| 109 |
if config.UserAgent == "" { |
| 110 |
config.UserAgent = rest.DefaultKubernetesUserAgent() |
| 111 |
} |
| 112 |
} |
| 113 |
|
| 114 |
|
| 115 |
|
| 116 |
func (c *AppsV1Client) RESTClient() rest.Interface { |
| 117 |
if c == nil { |
| 118 |
return nil |
| 119 |
} |
| 120 |
return c.restClient |
| 121 |
} |