...
1
16
17 package config
18
19 import (
20 apiserver "k8s.io/apiserver/pkg/server"
21 clientset "k8s.io/client-go/kubernetes"
22 restclient "k8s.io/client-go/rest"
23 "k8s.io/client-go/tools/record"
24 kubectrlmgrconfig "k8s.io/kubernetes/pkg/controller/apis/config"
25 )
26
27
28 type Config struct {
29 ComponentConfig kubectrlmgrconfig.KubeControllerManagerConfiguration
30
31 SecureServing *apiserver.SecureServingInfo
32
33 LoopbackClientConfig *restclient.Config
34
35 Authentication apiserver.AuthenticationInfo
36 Authorization apiserver.AuthorizationInfo
37
38
39 Client *clientset.Clientset
40
41
42 Kubeconfig *restclient.Config
43
44 EventBroadcaster record.EventBroadcaster
45 EventRecorder record.EventRecorder
46 }
47
48 type completedConfig struct {
49 *Config
50 }
51
52
53 type CompletedConfig struct {
54
55 *completedConfig
56 }
57
58
59 func (c *Config) Complete() *CompletedConfig {
60 cc := completedConfig{c}
61
62 apiserver.AuthorizeClientBearerToken(c.LoopbackClientConfig, &c.Authentication, &c.Authorization)
63
64 return &CompletedConfig{&cc}
65 }
66
View as plain text