File tree Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Expand file tree Collapse file tree 1 file changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -216,8 +216,15 @@ if [string match "Welcome to nginx!" $curl] {
216216}
217217puts "SUCCESS nginx responded well"
218218
219- send_sshcmd {kubectl exec $(kubectl get pods -l name==alpine -o=jsonpath='{.items[*].metadata.name}') -- wget -q -O - http://nginx/}
220- expect -i $ssh_sid -timeout 10 \
219+ # This also happens to test external connectivity...
220+ sshcmd "alpine install curl" {kubectl exec $(kubectl get pods -l name==alpine -o=jsonpath='{.items[*].metadata.name}') -- apk add --update curl}
221+
222+ # We rely on the expect -timeout to kill the infinite curl loop. The
223+ # loop is needed because it seems it sometimes takes the internal DNS
224+ # a while to settle, resulting in spurious `curl: (6) Could not
225+ # resolve host: nginx` failures.
226+ send_sshcmd {while ! kubectl exec $(kubectl get pods -l name==alpine -o=jsonpath='{.items[*].metadata.name}') -- curl -sS http://nginx/ ; do sleep 1s ; done}
227+ expect -i $ssh_sid -timeout 60 \
221228 "Welcome to nginx!" {
222229 puts "SUCCESS intra-pod networking ok"
223230 } $ssh_prompt {
You can’t perform that action at this time.
0 commit comments