@@ -109,31 +109,48 @@ func TestKubeEndpointConfiguration(t *testing.T) {
109
109
{
110
110
name : "no overrides supplied" ,
111
111
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
+ {
115
116
name : "HOST_ADDRESS override supplied" ,
116
117
envConfig : map [string ]string {
117
118
"HOST_ADDRESS" : "samplehost.testdomain.com" ,
118
119
},
119
120
expectedKubeletEndpoint : "http://samplehost.testdomain.com:10248/healthz" ,
120
121
expectedKubeProxyEndpoint : "http://samplehost.testdomain.com:10256/healthz" ,
121
122
},
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
+ },
122
139
{
123
140
name : "KUBELET_PORT override supplied" ,
124
141
envConfig : map [string ]string {
125
142
"KUBELET_PORT" : "12345" ,
126
143
},
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" ,
129
146
},
130
147
{
131
148
name : "KUBEPROXY_PORT override supplied" ,
132
149
envConfig : map [string ]string {
133
150
"KUBEPROXY_PORT" : "12345" ,
134
151
},
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" ,
137
154
},
138
155
{
139
156
name : "HOST_ADDRESS and KUBELET_PORT override supplied" ,
@@ -174,8 +191,8 @@ func TestKubeEndpointConfiguration(t *testing.T) {
174
191
kubeProxyHCEndpoint := KubeProxyHealthCheckEndpoint ()
175
192
kubeletHCEndpoint := KubeletHealthCheckEndpoint ()
176
193
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 )
179
196
})
180
197
}
181
198
}
0 commit comments