@@ -21,6 +21,7 @@ import (
21
21
"encoding/json"
22
22
"fmt"
23
23
"math/big"
24
+ "net"
24
25
"strings"
25
26
"time"
26
27
@@ -198,6 +199,12 @@ func TestSampleAPIServer(f *framework.Framework, aggrclient *aggregatorclient.Cl
198
199
podLabels := map [string ]string {"app" : "sample-apiserver" , "apiserver" : "true" }
199
200
replicas := int32 (1 )
200
201
zero := int64 (0 )
202
+ etcdLocalhostAddress := "127.0.0.1"
203
+ if framework .TestContext .ClusterIsIPv6 () {
204
+ etcdLocalhostAddress = "::1"
205
+ }
206
+ etcdURL := fmt .Sprintf ("http://%s" , net .JoinHostPort (etcdLocalhostAddress , "2379" ))
207
+
201
208
mounts := []v1.VolumeMount {
202
209
{
203
210
Name : "apiserver-certs" ,
@@ -218,7 +225,7 @@ func TestSampleAPIServer(f *framework.Framework, aggrclient *aggregatorclient.Cl
218
225
Name : "sample-apiserver" ,
219
226
VolumeMounts : mounts ,
220
227
Args : []string {
221
- "--etcd-servers=http://localhost:2379" ,
228
+ fmt . Sprintf ( "--etcd-servers=%s" , etcdURL ) ,
222
229
"--tls-cert-file=/apiserver.local.config/certificates/tls.crt" ,
223
230
"--tls-private-key-file=/apiserver.local.config/certificates/tls.key" ,
224
231
"--audit-log-path=-" ,
@@ -232,6 +239,10 @@ func TestSampleAPIServer(f *framework.Framework, aggrclient *aggregatorclient.Cl
232
239
Image : etcdImage ,
233
240
Command : []string {
234
241
"/usr/local/bin/etcd" ,
242
+ "--listen-client-urls" ,
243
+ etcdURL ,
244
+ "--advertise-client-urls" ,
245
+ etcdURL ,
235
246
},
236
247
},
237
248
}
0 commit comments