Skip to content

Commit

Permalink
remove RateLimitFilter in favor of BackendTrafficPolicy (#2083)
Browse files Browse the repository at this point in the history
* remove RateLimitFilter in favor of BackendTrafficPolicy

Relates to #2006

Signed-off-by: Arko Dasgupta <arko@tetrate.io>

* fix tests

Signed-off-by: Arko Dasgupta <arko@tetrate.io>

* fix e2e

Signed-off-by: Arko Dasgupta <arko@tetrate.io>

* fix docs

Signed-off-by: Arko Dasgupta <arko@tetrate.io>

* lint

Signed-off-by: Arko Dasgupta <arko@tetrate.io>

---------

Signed-off-by: Arko Dasgupta <arko@tetrate.io>
  • Loading branch information
arkodg authored Oct 27, 2023
1 parent c3ee960 commit 54803c1
Show file tree
Hide file tree
Showing 42 changed files with 170 additions and 3,904 deletions.
2 changes: 1 addition & 1 deletion api/v1alpha1/backendtrafficpolicy_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ type BackendTrafficPolicySpec struct {
// RateLimit allows the user to limit the number of incoming requests
// to a predefined value based on attributes within the traffic flow.
// +optional
RateLimit *RateLimitFilterSpec `json:"rateLimit,omitempty"`
RateLimit *RateLimitSpec `json:"rateLimit,omitempty"`

// LoadBalancer policy to apply when routing traffic from the gateway to
// the backend endpoints
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,31 +5,9 @@

package v1alpha1

import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
// KindRateLimitFilter is the name of the RateLimitFilter kind.
KindRateLimitFilter = "RateLimitFilter"
)

// +kubebuilder:object:root=true
// +kubebuilder:printcolumn:name="Age",type=date,JSONPath=`.metadata.creationTimestamp`

// RateLimitFilter allows the user to limit the number of incoming requests
// to a predefined value based on attributes within the traffic flow.
type RateLimitFilter struct {
metav1.TypeMeta `json:",inline"`
metav1.ObjectMeta `json:"metadata,omitempty"`

// Spec defines the desired state of RateLimitFilter.
Spec RateLimitFilterSpec `json:"spec"`
}

// RateLimitFilterSpec defines the desired state of RateLimitFilter.
// RateLimitSpec defines the desired state of RateLimitSpec.
// +union
type RateLimitFilterSpec struct {
type RateLimitSpec struct {
// Type decides the scope for the RateLimits.
// Valid RateLimitType values are "Global".
//
Expand Down Expand Up @@ -184,16 +162,3 @@ type RateLimitValue struct {
//
// +kubebuilder:validation:Enum=Second;Minute;Hour;Day
type RateLimitUnit string

//+kubebuilder:object:root=true

// RateLimitFilterList contains a list of RateLimitFilter resources.
type RateLimitFilterList struct {
metav1.TypeMeta `json:",inline"`
metav1.ListMeta `json:"metadata,omitempty"`
Items []RateLimitFilter `json:"items"`
}

func init() {
SchemeBuilder.Register(&RateLimitFilter{}, &RateLimitFilterList{})
}
100 changes: 21 additions & 79 deletions api/v1alpha1/zz_generated.deepcopy.go

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

This file was deleted.

Loading

0 comments on commit 54803c1

Please sign in to comment.