Merge pull request #129049 from npinaeva/curl-timeout

[e2e, service] Add total timeout for affinity check curl command.
This commit is contained in:
Kubernetes Prow Robot 2024-12-12 05:29:27 +00:00 committed by GitHub
commit d4bfa1e059
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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)