Skip to content

Commit

Permalink
fix: throttleHost is not array in ExternalRateLimit (#633)
Browse files Browse the repository at this point in the history
* fix: throttleHost is not array in ExternalRateLimit

Signed-off-by: Lin Yang <[email protected]>

* fix: comment

Signed-off-by: Lin Yang <[email protected]>

* fix: make manifests

Signed-off-by: Lin Yang <[email protected]>

---------

Signed-off-by: Lin Yang <[email protected]>
  • Loading branch information
reaver-flomesh authored Jan 14, 2025
1 parent 2bd3bec commit 202805c
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,17 +60,11 @@ spec:
type: array
x-kubernetes-list-type: set
throttleHost:
description: ThrottleHosts is the list of hosts to be throttled
items:
description: HostPort is a host name with optional port number
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(:[0-9]{1,5})?$
type: string
maxItems: 32
minItems: 1
type: array
x-kubernetes-list-type: set
description: ThrottleHost is the host to be throttled
maxLength: 253
minLength: 1
pattern: ^[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*(:[0-9]{1,5})?$
type: string
type: object
status:
description: ExternalRateLimitStatus defines the observed state of ExternalRateLimit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ spec:
description: RequestTerminationSpec defines the desired state of RequestTermination
properties:
response:
description: RequestTerminationResponse is the response when circuit
breaker triggered
description: RequestTerminationResponse is the response when request
termination triggered
properties:
body:
default: Request termination triggered
Expand Down
7 changes: 2 additions & 5 deletions pkg/apis/extension/v1alpha1/externalratelimit.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ import (

// ExternalRateLimitSpec defines the desired state of ExternalRateLimit
type ExternalRateLimitSpec struct {
// +listType=set
// +kubebuilder:validation:MinItems=1
// +kubebuilder:validation:MaxItems=32
// ThrottleHosts is the list of hosts to be throttled
ThrottleHosts []HostPort `json:"throttleHost,omitempty"`
// ThrottleHost is the host to be throttled
ThrottleHost HostPort `json:"throttleHost,omitempty"`

// +optional
// +listType=set
Expand Down
2 changes: 1 addition & 1 deletion pkg/apis/extension/v1alpha1/requesttermination.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (

// RequestTerminationSpec defines the desired state of RequestTermination
type RequestTerminationSpec struct {
// RequestTerminationResponse is the response when circuit breaker triggered
// RequestTerminationResponse is the response when request termination triggered
RequestTerminationResponse RequestTerminationResponse `json:"response,omitempty"`
}

Expand Down
5 changes: 0 additions & 5 deletions pkg/apis/extension/v1alpha1/zz_generated.deepcopy.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 202805c

Please sign in to comment.