mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-13 13:55:41 +00:00
[e2e, service] Add total timeout for affinity check curl command.
Not setting a total timeout for curl may result in hanging command if the connection succeeded, but the data transfer did not. Signed-off-by: Nadia Pinaeva <n.m.pinaeva@gmail.com>
This commit is contained in:
parent
810e9e212e
commit
326c84a151
@ -142,7 +142,7 @@ func affinityCheckFromPod(execPod *v1.Pod, serviceIP string, servicePort int) (t
|
||||
interval := 2 * AffinityConfirmCount * time.Second
|
||||
|
||||
serviceIPPort := net.JoinHostPort(serviceIP, strconv.Itoa(servicePort))
|
||||
curl := fmt.Sprintf(`curl -q -s --connect-timeout 2 http://%s/`, serviceIPPort)
|
||||
curl := fmt.Sprintf(`curl -q -s --connect-timeout 2 --max-time 60 http://%s/`, serviceIPPort)
|
||||
cmd := fmt.Sprintf("for i in $(seq 0 %d); do echo; %s ; done", AffinityConfirmCount, curl)
|
||||
getHosts := func() []string {
|
||||
stdout, err := e2eoutput.RunHostCmd(execPod.Namespace, execPod.Name, cmd)
|
||||
|
Loading…
Reference in New Issue
Block a user