Skip to content

Commit

Permalink
fix: remove obselete flags from redis options
Browse files Browse the repository at this point in the history
  • Loading branch information
KevFan committed May 13, 2024
1 parent 0713794 commit 74488f8
Show file tree
Hide file tree
Showing 7 changed files with 0 additions and 48 deletions.
8 changes: 0 additions & 8 deletions api/v1alpha1/limitador_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -207,14 +207,6 @@ type Redis struct {
}

type RedisCachedOptions struct {
// +optional
// TTL for cached counters in milliseconds [default: 5000]
TTL *int `json:"ttl,omitempty"`

// +optional
// Ratio to apply to the TTL from Redis on cached counters [default: 10]
Ratio *int `json:"ratio,omitempty"`

// +optional
// FlushPeriod for counters in milliseconds [default: 1000]
FlushPeriod *int `json:"flush-period,omitempty"`
Expand Down
10 changes: 0 additions & 10 deletions api/v1alpha1/zz_generated.deepcopy.go

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

8 changes: 0 additions & 8 deletions bundle/manifests/limitador.kuadrant.io_limitadors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1061,18 +1061,10 @@ spec:
description: 'MaxCached refers to the maximum amount of
counters cached [default: 10000]'
type: integer
ratio:
description: 'Ratio to apply to the TTL from Redis on
cached counters [default: 10]'
type: integer
response-timeout:
description: 'ResponseTimeout defines the timeout for
Redis commands in milliseconds [default: 350]'
type: integer
ttl:
description: 'TTL for cached counters in milliseconds
[default: 5000]'
type: integer
type: object
type: object
type: object
Expand Down
8 changes: 0 additions & 8 deletions config/crd/bases/limitador.kuadrant.io_limitadors.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1062,18 +1062,10 @@ spec:
description: 'MaxCached refers to the maximum amount of
counters cached [default: 10000]'
type: integer
ratio:
description: 'Ratio to apply to the TTL from Redis on
cached counters [default: 10]'
type: integer
response-timeout:
description: 'ResponseTimeout defines the timeout for
Redis commands in milliseconds [default: 350]'
type: integer
ttl:
description: 'TTL for cached counters in milliseconds
[default: 5000]'
type: integer
type: object
type: object
type: object
Expand Down
4 changes: 0 additions & 4 deletions controllers/limitador_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -600,8 +600,6 @@ var _ = Describe("Limitador controller", func() {
It("with all the optional parameters, the command line is correct", func(ctx SpecContext) {
limitadorObj := limitadorWithRedisCachedStorage(client.ObjectKeyFromObject(redisSecret), testNamespace)
limitadorObj.Spec.Storage.RedisCached.Options = &limitadorv1alpha1.RedisCachedOptions{
TTL: ptr.To(1),
Ratio: ptr.To(2),
FlushPeriod: ptr.To(3),
MaxCached: ptr.To(4),
ResponseTimeout: ptr.To(5),
Expand Down Expand Up @@ -632,8 +630,6 @@ var _ = Describe("Limitador controller", func() {
"/home/limitador/etc/limitador-config.yaml",
"redis_cached",
"$(LIMITADOR_OPERATOR_REDIS_URL)",
"--ttl", "1",
"--ratio", "2",
"--flush-period", "3",
"--max-cached", "4",
"--response-timeout", "5",
Expand Down
6 changes: 0 additions & 6 deletions pkg/limitador/redis_cache_storage_options.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ func RedisCachedDeploymentOptions(ctx context.Context, cl client.Client, defSecr

command := []string{"redis_cached", "$(LIMITADOR_OPERATOR_REDIS_URL)"}
if redisCachedObj.Options != nil {
if redisCachedObj.Options.TTL != nil {
command = append(command, "--ttl", strconv.Itoa(*redisCachedObj.Options.TTL))
}
if redisCachedObj.Options.Ratio != nil {
command = append(command, "--ratio", strconv.Itoa(*redisCachedObj.Options.Ratio))
}
if redisCachedObj.Options.FlushPeriod != nil {
command = append(command, "--flush-period", strconv.Itoa(*redisCachedObj.Options.FlushPeriod))
}
Expand Down
4 changes: 0 additions & 4 deletions pkg/limitador/redis_cache_storage_options_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ func TestRedisCachedDeploymentOptions(t *testing.T) {
redisObj := limitadorv1alpha1.RedisCached{
ConfigSecretRef: &v1.LocalObjectReference{Name: "redisSecret"},
Options: &limitadorv1alpha1.RedisCachedOptions{
TTL: ptr.To(1),
Ratio: ptr.To(2),
FlushPeriod: ptr.To(3),
MaxCached: ptr.To(4),
ResponseTimeout: ptr.To(5),
Expand All @@ -119,8 +117,6 @@ func TestRedisCachedDeploymentOptions(t *testing.T) {
Command: []string{
"redis_cached",
"$(LIMITADOR_OPERATOR_REDIS_URL)",
"--ttl", "1",
"--ratio", "2",
"--flush-period", "3",
"--max-cached", "4",
"--response-timeout", "5",
Expand Down

0 comments on commit 74488f8

Please sign in to comment.