@@ -109,31 +109,48 @@ func TestKubeEndpointConfiguration(t *testing.T) {
109109 {
110110 name : "no overrides supplied" ,
111111 envConfig : map [string ]string {},
112- expectedKubeletEndpoint : "http://127.0.0.1:10248/healthz" ,
113- expectedKubeProxyEndpoint : "http://127.0.0.1:10256/healthz" ,
114- }, {
112+ expectedKubeletEndpoint : "http://localhost:10248/healthz" ,
113+ expectedKubeProxyEndpoint : "http://localhost:10256/healthz" ,
114+ },
115+ {
115116 name : "HOST_ADDRESS override supplied" ,
116117 envConfig : map [string ]string {
117118 "HOST_ADDRESS" : "samplehost.testdomain.com" ,
118119 },
119120 expectedKubeletEndpoint : "http://samplehost.testdomain.com:10248/healthz" ,
120121 expectedKubeProxyEndpoint : "http://samplehost.testdomain.com:10256/healthz" ,
121122 },
123+ {
124+ name : "HOST_ADDRESS override supplied with IPv4" ,
125+ envConfig : map [string ]string {
126+ "HOST_ADDRESS" : "10.0.5.4" ,
127+ },
128+ expectedKubeletEndpoint : "http://10.0.5.4:10248/healthz" ,
129+ expectedKubeProxyEndpoint : "http://10.0.5.4:10256/healthz" ,
130+ },
131+ {
132+ name : "HOST_ADDRESS override supplied with IPv6" ,
133+ envConfig : map [string ]string {
134+ "HOST_ADDRESS" : "80:f4:16::1" ,
135+ },
136+ expectedKubeletEndpoint : "http://[80:f4:16::1]:10248/healthz" ,
137+ expectedKubeProxyEndpoint : "http://[80:f4:16::1]:10256/healthz" ,
138+ },
122139 {
123140 name : "KUBELET_PORT override supplied" ,
124141 envConfig : map [string ]string {
125142 "KUBELET_PORT" : "12345" ,
126143 },
127- expectedKubeletEndpoint : "http://127.0.0.1 :12345/healthz" ,
128- expectedKubeProxyEndpoint : "http://127.0.0.1 :10256/healthz" ,
144+ expectedKubeletEndpoint : "http://localhost :12345/healthz" ,
145+ expectedKubeProxyEndpoint : "http://localhost :10256/healthz" ,
129146 },
130147 {
131148 name : "KUBEPROXY_PORT override supplied" ,
132149 envConfig : map [string ]string {
133150 "KUBEPROXY_PORT" : "12345" ,
134151 },
135- expectedKubeletEndpoint : "http://127.0.0.1 :10248/healthz" ,
136- expectedKubeProxyEndpoint : "http://127.0.0.1 :12345/healthz" ,
152+ expectedKubeletEndpoint : "http://localhost :10248/healthz" ,
153+ expectedKubeProxyEndpoint : "http://localhost :12345/healthz" ,
137154 },
138155 {
139156 name : "HOST_ADDRESS and KUBELET_PORT override supplied" ,
@@ -174,8 +191,8 @@ func TestKubeEndpointConfiguration(t *testing.T) {
174191 kubeProxyHCEndpoint := KubeProxyHealthCheckEndpoint ()
175192 kubeletHCEndpoint := KubeletHealthCheckEndpoint ()
176193
177- assert .Equal (t , kubeProxyHCEndpoint , test .expectedKubeProxyEndpoint )
178- assert .Equal (t , kubeletHCEndpoint , test .expectedKubeletEndpoint )
194+ assert .Equal (t , test .expectedKubeProxyEndpoint , kubeProxyHCEndpoint )
195+ assert .Equal (t , test .expectedKubeletEndpoint , kubeletHCEndpoint )
179196 })
180197 }
181198}
0 commit comments