-
Notifications
You must be signed in to change notification settings - Fork 0
/
api.go
44 lines (36 loc) · 1.18 KB
/
api.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package v1alpha1
import (
"k8s.io/apimachinery/pkg/runtime/schema"
"k8s.io/apimachinery/pkg/runtime/serializer"
"k8s.io/client-go/kubernetes/scheme"
"k8s.io/client-go/rest"
)
type ExampleV1Alpha1Interface interface {
RESTClient() rest.Interface
MigrationPod(namespace string) MigrationPodInterface
}
type ExampleV1Alpha1Client struct {
restClient rest.Interface
pod *MigrationPodClient
}
func NewForConfig(c *rest.Config) (*ExampleV1Alpha1Client, error) {
config := *c
config.ContentConfig.GroupVersion = &schema.GroupVersion{Group: "keti.migration", Version: "v1"}
config.APIPath = "/apis"
config.NegotiatedSerializer = serializer.NewCodecFactory(scheme.Scheme)
config.UserAgent = rest.DefaultKubernetesUserAgent()
client, err := rest.RESTClientFor(&config)
if err != nil {
return nil, err
}
return &ExampleV1Alpha1Client{restClient: client}, nil
}
func (c *ExampleV1Alpha1Client) RESTClient() rest.Interface {
if c == nil {
return nil
}
return c.restClient
}
func (c *ExampleV1Alpha1Client) MigrationPod(namespace string) MigrationPodInterface {
return newMigrationPodClient(c,namespace)
}