1
0
Fork 0

Add unhealthy Interval to the health check configuration

This commit is contained in:
Swastik Sarkar 2025-04-09 13:40:05 +05:30 committed by GitHub
parent 6c3b099c25
commit d7d0017545
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
36 changed files with 701 additions and 295 deletions

View file

@ -162,6 +162,7 @@ func TestDecodeConfiguration(t *testing.T) {
"traefik.http.services.Service0.loadbalancer.healthcheck.headers.name1": "foobar",
"traefik.http.services.Service0.loadbalancer.healthcheck.hostname": "foobar",
"traefik.http.services.Service0.loadbalancer.healthcheck.interval": "1s",
"traefik.http.services.Service0.loadbalancer.healthcheck.unhealthyinterval": "1s",
"traefik.http.services.Service0.loadbalancer.healthcheck.path": "foobar",
"traefik.http.services.Service0.loadbalancer.healthcheck.method": "foobar",
"traefik.http.services.Service0.loadbalancer.healthcheck.status": "401",
@ -186,6 +187,7 @@ func TestDecodeConfiguration(t *testing.T) {
"traefik.http.services.Service1.loadbalancer.healthcheck.headers.name1": "foobar",
"traefik.http.services.Service1.loadbalancer.healthcheck.hostname": "foobar",
"traefik.http.services.Service1.loadbalancer.healthcheck.interval": "1s",
"traefik.http.services.Service1.loadbalancer.healthcheck.unhealthyinterval": "1s",
"traefik.http.services.Service1.loadbalancer.healthcheck.path": "foobar",
"traefik.http.services.Service1.loadbalancer.healthcheck.method": "foobar",
"traefik.http.services.Service1.loadbalancer.healthcheck.status": "401",
@ -701,15 +703,16 @@ func TestDecodeConfiguration(t *testing.T) {
},
},
HealthCheck: &dynamic.ServerHealthCheck{
Scheme: "foobar",
Mode: "foobar",
Path: "foobar",
Method: "foobar",
Status: 401,
Port: 42,
Interval: ptypes.Duration(time.Second),
Timeout: ptypes.Duration(time.Second),
Hostname: "foobar",
Scheme: "foobar",
Mode: "foobar",
Path: "foobar",
Method: "foobar",
Status: 401,
Port: 42,
Interval: ptypes.Duration(time.Second),
UnhealthyInterval: pointer(ptypes.Duration(time.Second)),
Timeout: ptypes.Duration(time.Second),
Hostname: "foobar",
Headers: map[string]string{
"name0": "foobar",
"name1": "foobar",
@ -735,15 +738,16 @@ func TestDecodeConfiguration(t *testing.T) {
},
},
HealthCheck: &dynamic.ServerHealthCheck{
Scheme: "foobar",
Mode: "foobar",
Path: "foobar",
Method: "foobar",
Status: 401,
Port: 42,
Interval: ptypes.Duration(time.Second),
Timeout: ptypes.Duration(time.Second),
Hostname: "foobar",
Scheme: "foobar",
Mode: "foobar",
Path: "foobar",
Method: "foobar",
Status: 401,
Port: 42,
Interval: ptypes.Duration(time.Second),
UnhealthyInterval: pointer(ptypes.Duration(time.Second)),
Timeout: ptypes.Duration(time.Second),
Hostname: "foobar",
Headers: map[string]string{
"name0": "foobar",
"name1": "foobar",
@ -1244,14 +1248,15 @@ func TestEncodeConfiguration(t *testing.T) {
},
},
HealthCheck: &dynamic.ServerHealthCheck{
Scheme: "foobar",
Path: "foobar",
Method: "foobar",
Status: 401,
Port: 42,
Interval: ptypes.Duration(time.Second),
Timeout: ptypes.Duration(time.Second),
Hostname: "foobar",
Scheme: "foobar",
Path: "foobar",
Method: "foobar",
Status: 401,
Port: 42,
Interval: ptypes.Duration(time.Second),
UnhealthyInterval: pointer(ptypes.Duration(time.Second)),
Timeout: ptypes.Duration(time.Second),
Hostname: "foobar",
Headers: map[string]string{
"name0": "foobar",
"name1": "foobar",
@ -1276,14 +1281,15 @@ func TestEncodeConfiguration(t *testing.T) {
},
},
HealthCheck: &dynamic.ServerHealthCheck{
Scheme: "foobar",
Path: "foobar",
Method: "foobar",
Status: 401,
Port: 42,
Interval: ptypes.Duration(time.Second),
Timeout: ptypes.Duration(time.Second),
Hostname: "foobar",
Scheme: "foobar",
Path: "foobar",
Method: "foobar",
Status: 401,
Port: 42,
Interval: ptypes.Duration(time.Second),
UnhealthyInterval: pointer(ptypes.Duration(time.Second)),
Timeout: ptypes.Duration(time.Second),
Hostname: "foobar",
Headers: map[string]string{
"name0": "foobar",
"name1": "foobar",
@ -1471,6 +1477,7 @@ func TestEncodeConfiguration(t *testing.T) {
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Headers.name1": "foobar",
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Hostname": "foobar",
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Interval": "1000000000",
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.UnhealthyInterval": "1000000000",
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Path": "foobar",
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Method": "foobar",
"traefik.HTTP.Services.Service0.LoadBalancer.HealthCheck.Status": "401",
@ -1495,6 +1502,7 @@ func TestEncodeConfiguration(t *testing.T) {
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Headers.name1": "foobar",
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Hostname": "foobar",
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Interval": "1000000000",
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.UnhealthyInterval": "1000000000",
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Path": "foobar",
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Method": "foobar",
"traefik.HTTP.Services.Service1.LoadBalancer.HealthCheck.Status": "401",