Skip to content

Commit

Permalink
Fix json tags for added fields
Browse files Browse the repository at this point in the history
  • Loading branch information
thisisnotashwin committed May 19, 2023
1 parent f078a77 commit cb31a6f
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 26 deletions.
3 changes: 3 additions & 0 deletions .changelog/2160.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```release-note:bug
control-plane: fix issue with json tags of service defaults fields EnforcingConsecutive5xx, MaxEjectionPercent and BaseEjectionTime.
```
34 changes: 26 additions & 8 deletions charts/consul/templates/crd-servicedefaults.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,12 +275,14 @@ spec:
the load balancing pool.
properties:
baseEjectionTime:
description: The base time that a host is ejected for. The
real time is equal to the base time multiplied by the number
of times the host has been ejected and is capped by
max_ejection_time (Default 300s). Defaults to 30s.
type: string
enforcing_consecutive_5xx:
description: The base time that a host is ejected for.
The real time is equal to the base time multiplied by
the number of times the host has been ejected and is
capped by max_ejection_time (Default 300s). Defaults
to 30000ms or 30s.
format: int64
type: integer
enforcingConsecutive5xx:
description: EnforcingConsecutive5xx is the % chance that
a host will be actually ejected when an outlier status
is detected through consecutive 5xx. This setting can
Expand All @@ -294,7 +296,8 @@ spec:
maxEjectionPercent:
description: The maximum % of an upstream cluster that
can be ejected due to outlier detection. Defaults to
10% but will eject at least one host regardless of the value.
10% but will eject at least one host regardless of the
value.
format: int32
type: integer
maxFailures:
Expand Down Expand Up @@ -389,7 +392,15 @@ spec:
how upstream proxy instances will be monitored for removal
from the load balancing pool.
properties:
enforcing_consecutive_5xx:
baseEjectionTime:
description: The base time that a host is ejected for.
The real time is equal to the base time multiplied
by the number of times the host has been ejected and
is capped by max_ejection_time (Default 300s). Defaults
to 30000ms or 30s.
format: int64
type: integer
enforcingConsecutive5xx:
description: EnforcingConsecutive5xx is the % chance
that a host will be actually ejected when an outlier
status is detected through consecutive 5xx. This setting
Expand All @@ -401,6 +412,13 @@ spec:
sweeps. Each sweep may remove hosts or return hosts
to the pool.
type: string
maxEjectionPercent:
description: The maximum % of an upstream cluster that
can be ejected due to outlier detection. Defaults
to 10% but will eject at least one host regardless
of the value.
format: int32
type: integer
maxFailures:
description: MaxFailures is the count of consecutive
failures that results in a host being removed from
Expand Down
6 changes: 3 additions & 3 deletions control-plane/api/v1alpha1/servicedefaults_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,14 @@ type PassiveHealthCheck struct {
// EnforcingConsecutive5xx is the % chance that a host will be actually ejected
// when an outlier status is detected through consecutive 5xx.
// This setting can be used to disable ejection or to ramp it up slowly.
EnforcingConsecutive5xx *uint32 `json:"enforcing_consecutive_5xx,omitempty"`
EnforcingConsecutive5xx *uint32 `json:"enforcingConsecutive5xx,omitempty"`
// The maximum % of an upstream cluster that can be ejected due to outlier detection.
// Defaults to 10% but will eject at least one host regardless of the value.
MaxEjectionPercent *uint32 `json:",omitempty" alias:"max_ejection_percent"`
MaxEjectionPercent *uint32 `json:"maxEjectionPercent,omitempty"`
// The base time that a host is ejected for. The real time is equal to the base time
// multiplied by the number of times the host has been ejected and is capped by
// max_ejection_time (Default 300s). Defaults to 30000ms or 30s.
BaseEjectionTime *time.Duration `json:",omitempty" alias:"base_ejection_time"`
BaseEjectionTime *time.Duration `json:"baseEjectionTime,omitempty"`
}

type ServiceDefaultsDestination struct {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,12 +268,14 @@ spec:
the load balancing pool.
properties:
baseEjectionTime:
description: The base time that a host is ejected for. The
real time is equal to the base time multiplied by the number
of times the host has been ejected and is capped by
max_ejection_time (Default 300s). Defaults to 30s.
type: string
enforcing_consecutive_5xx:
description: The base time that a host is ejected for.
The real time is equal to the base time multiplied by
the number of times the host has been ejected and is
capped by max_ejection_time (Default 300s). Defaults
to 30000ms or 30s.
format: int64
type: integer
enforcingConsecutive5xx:
description: EnforcingConsecutive5xx is the % chance that
a host will be actually ejected when an outlier status
is detected through consecutive 5xx. This setting can
Expand All @@ -287,7 +289,8 @@ spec:
maxEjectionPercent:
description: The maximum % of an upstream cluster that
can be ejected due to outlier detection. Defaults to
10% but will eject at least one host regardless of the value.
10% but will eject at least one host regardless of the
value.
format: int32
type: integer
maxFailures:
Expand Down Expand Up @@ -383,12 +386,14 @@ spec:
from the load balancing pool.
properties:
baseEjectionTime:
description: The base time that a host is ejected for. The
real time is equal to the base time multiplied by the number
of times the host has been ejected and is capped by
max_ejection_time (Default 300s). Defaults to 30s.
type: string
enforcing_consecutive_5xx:
description: The base time that a host is ejected for.
The real time is equal to the base time multiplied
by the number of times the host has been ejected and
is capped by max_ejection_time (Default 300s). Defaults
to 30000ms or 30s.
format: int64
type: integer
enforcingConsecutive5xx:
description: EnforcingConsecutive5xx is the % chance
that a host will be actually ejected when an outlier
status is detected through consecutive 5xx. This setting
Expand All @@ -402,8 +407,9 @@ spec:
type: string
maxEjectionPercent:
description: The maximum % of an upstream cluster that
can be ejected due to outlier detection. Defaults to
10% but will eject at least one host regardless of the value.
can be ejected due to outlier detection. Defaults
to 10% but will eject at least one host regardless
of the value.
format: int32
type: integer
maxFailures:
Expand Down

0 comments on commit cb31a6f

Please sign in to comment.