Add timeouts to HealthChecks and retry checks

Fixes issue #3532. Added timeouts for HTTP and TCP checks
and enabled kubelet/probe to kubelet#maxRetries times
before declaring Failure.

Added Probe.TimeoutSecs to API

Probe variants now check container.LivenessProbe.TimeoutSeconds
Also added a test for timeouts in http_test.go.
This commit is contained in:
George Kuan
2015-01-28 20:35:49 -08:00
parent e335e2d3e2
commit e8c33b7916
12 changed files with 60 additions and 21 deletions

View File

@@ -23,6 +23,7 @@ import (
"net/url"
"strconv"
"testing"
"time"
"github.com/GoogleCloudPlatform/kubernetes/pkg/probe"
)
@@ -59,7 +60,7 @@ func TestTcpHealthChecker(t *testing.T) {
if !test.usePort {
p = -1
}
status, err := prober.Probe(host, p)
status, err := prober.Probe(host, p, 1*time.Second)
if status != test.expectedStatus {
t.Errorf("expected: %v, got: %v", test.expectedStatus, status)
}