Skip to content

Commit 3aecde0

Browse files
committed
update by codereview
Signed-off-by: dongjiang1989 <[email protected]>
1 parent e90c23d commit 3aecde0

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

cmd/metrics-server/app/options/kubelet_client.go

-1
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ func (o KubeletClientOptions) Config(restConfig *rest.Config) *client.KubeletCli
112112
config.Client.TLSClientConfig = rest.TLSClientConfig{} // empty TLS config --> no TLS
113113
}
114114
if o.InsecureKubeletTLS {
115-
config.Client.TLSClientConfig = rest.TLSClientConfig{}
116115
config.Client.TLSClientConfig.Insecure = true
117116
config.Client.TLSClientConfig.NextProtos = []string{"http/1.1", "h2"}
118117
}

cmd/metrics-server/app/options/kubelet_client_test.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,13 @@ func TestConfig(t *testing.T) {
7575
expectFunc: func() client.KubeletClientConfig {
7676
e := expected
7777
e.Client.Insecure = true
78-
e.Client.CAFile = ""
79-
e.Client.CAData = nil
78+
e.Client.KeyFile = "KeyFile"
79+
e.Client.KeyData = []byte("KeyData")
80+
e.Client.CAFile = "CAFile"
81+
e.Client.CAData = []byte("CAData")
82+
e.Client.CertFile = "CertFile"
83+
e.Client.CertData = []byte("CertData")
84+
e.Client.NextProtos = []string{"http/1.1", "h2"}
8085
return e
8186
},
8287
},

0 commit comments

Comments
 (0)