Adds the missing circuit-breaker response code for CRD
This commit is contained in:
parent
a6b00608d2
commit
95312d5324
5 changed files with 18 additions and 0 deletions
|
@ -814,6 +814,10 @@ spec:
|
||||||
breaker will try to recover (as soon as it is in recovering
|
breaker will try to recover (as soon as it is in recovering
|
||||||
state).
|
state).
|
||||||
x-kubernetes-int-or-string: true
|
x-kubernetes-int-or-string: true
|
||||||
|
responseCode:
|
||||||
|
description: ResponseCode is the status code that the circuit
|
||||||
|
breaker will return while it is in the open state.
|
||||||
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
compress:
|
compress:
|
||||||
description: |-
|
description: |-
|
||||||
|
|
|
@ -172,6 +172,10 @@ spec:
|
||||||
breaker will try to recover (as soon as it is in recovering
|
breaker will try to recover (as soon as it is in recovering
|
||||||
state).
|
state).
|
||||||
x-kubernetes-int-or-string: true
|
x-kubernetes-int-or-string: true
|
||||||
|
responseCode:
|
||||||
|
description: ResponseCode is the status code that the circuit
|
||||||
|
breaker will return while it is in the open state.
|
||||||
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
compress:
|
compress:
|
||||||
description: |-
|
description: |-
|
||||||
|
|
|
@ -814,6 +814,10 @@ spec:
|
||||||
breaker will try to recover (as soon as it is in recovering
|
breaker will try to recover (as soon as it is in recovering
|
||||||
state).
|
state).
|
||||||
x-kubernetes-int-or-string: true
|
x-kubernetes-int-or-string: true
|
||||||
|
responseCode:
|
||||||
|
description: ResponseCode is the status code that the circuit
|
||||||
|
breaker will return while it is in the open state.
|
||||||
|
type: integer
|
||||||
type: object
|
type: object
|
||||||
compress:
|
compress:
|
||||||
description: |-
|
description: |-
|
||||||
|
|
|
@ -645,6 +645,10 @@ func createCircuitBreakerMiddleware(circuitBreaker *traefikv1alpha1.CircuitBreak
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if circuitBreaker.ResponseCode != 0 {
|
||||||
|
cb.ResponseCode = circuitBreaker.ResponseCode
|
||||||
|
}
|
||||||
|
|
||||||
return cb, nil
|
return cb, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -88,6 +88,8 @@ type CircuitBreaker struct {
|
||||||
FallbackDuration *intstr.IntOrString `json:"fallbackDuration,omitempty" toml:"fallbackDuration,omitempty" yaml:"fallbackDuration,omitempty" export:"true"`
|
FallbackDuration *intstr.IntOrString `json:"fallbackDuration,omitempty" toml:"fallbackDuration,omitempty" yaml:"fallbackDuration,omitempty" export:"true"`
|
||||||
// RecoveryDuration is the duration for which the circuit breaker will try to recover (as soon as it is in recovering state).
|
// RecoveryDuration is the duration for which the circuit breaker will try to recover (as soon as it is in recovering state).
|
||||||
RecoveryDuration *intstr.IntOrString `json:"recoveryDuration,omitempty" toml:"recoveryDuration,omitempty" yaml:"recoveryDuration,omitempty" export:"true"`
|
RecoveryDuration *intstr.IntOrString `json:"recoveryDuration,omitempty" toml:"recoveryDuration,omitempty" yaml:"recoveryDuration,omitempty" export:"true"`
|
||||||
|
// ResponseCode is the status code that the circuit breaker will return while it is in the open state.
|
||||||
|
ResponseCode int `json:"responseCode,omitempty" toml:"responseCode,omitempty" yaml:"responseCode,omitempty" export:"true"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// +k8s:deepcopy-gen=true
|
// +k8s:deepcopy-gen=true
|
||||||
|
|
Loading…
Reference in a new issue