@@ -218,17 +218,8 @@ var _ = Describe("APIServer", func() {
218218 return cert
219219 }
220220
221- Context ("when SecureServing host & port are set" , func () {
222- BeforeEach (func () {
223- server .SecureServing = SecureServing {
224- ListenAddr : process.ListenAddr {
225- Address : "1.2.3.4" ,
226- Port : "5678" ,
227- },
228- }
229- })
230-
231- It ("should have the host in the certificate altnames" , func () {
221+ Context ("when SecureServing are not set" , func () {
222+ It ("should have localhost/127.0.0.1 in the certificate altnames" , func () {
232223 cert := getCertificate ()
233224
234225 Expect (cert .Subject .CommonName ).To (Equal ("localhost" ))
@@ -241,39 +232,14 @@ var _ = Describe("APIServer", func() {
241232 })
242233 })
243234
244- Context ("when InsecureServing host & port are set" , func () {
245- BeforeEach (func () {
246- server .InsecureServing = & process.ListenAddr {
247- Address : "1.2.3.4" ,
248- Port : "5678" ,
249- }
250- })
251-
252- It ("should have the host in the certificate altnames" , func () {
253- cert := getCertificate ()
254-
255- Expect (cert .Subject .CommonName ).To (Equal ("localhost" ))
256- Expect (cert .DNSNames ).To (ConsistOf ("localhost" ))
257- expectedIPAddresses := []net.IP {
258- net .ParseIP ("127.0.0.1" ).To4 (),
259- net .ParseIP (server .InsecureServing .Address ).To4 (),
260- }
261- Expect (cert .IPAddresses ).To (ContainElements (expectedIPAddresses ))
262- })
263- })
264-
265- Context ("when SecureServing and InsecureServing host & port are set" , func () {
235+ Context ("when SecureServing host & port are set" , func () {
266236 BeforeEach (func () {
267237 server .SecureServing = SecureServing {
268238 ListenAddr : process.ListenAddr {
269239 Address : "1.2.3.4" ,
270240 Port : "5678" ,
271241 },
272242 }
273- server .InsecureServing = & process.ListenAddr {
274- Address : "5.6.7.8" ,
275- Port : "1234" ,
276- }
277243 })
278244
279245 It ("should have the host in the certificate altnames" , func () {
@@ -284,7 +250,6 @@ var _ = Describe("APIServer", func() {
284250 expectedIPAddresses := []net.IP {
285251 net .ParseIP ("127.0.0.1" ).To4 (),
286252 net .ParseIP (server .SecureServing .ListenAddr .Address ).To4 (),
287- net .ParseIP (server .InsecureServing .Address ).To4 (),
288253 }
289254 Expect (cert .IPAddresses ).To (ContainElements (expectedIPAddresses ))
290255 })
0 commit comments