Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: throttleHost is not array in ExternalRateLimit #633

Merged
merged 3 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.

Loading