Skip to content

Commit

Permalink
Add support for name in limit definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
alexsnaps committed Nov 7, 2023
1 parent c172d5f commit a90c6cb
Show file tree
Hide file tree
Showing 10 changed files with 114 additions and 128 deletions.
1 change: 1 addition & 0 deletions api/v1alpha1/limitador_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ type RateLimit struct {
Namespace string `json:"namespace"`
Seconds int `json:"seconds"`
Variables []string `json:"variables"`
Name string `json:"name,omitempty"`
}

// LimitadorStatus defines the observed state of Limitador
Expand Down
2 changes: 1 addition & 1 deletion bundle.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ LABEL operators.operatorframework.io.bundle.manifests.v1=manifests/
LABEL operators.operatorframework.io.bundle.metadata.v1=metadata/
LABEL operators.operatorframework.io.bundle.package.v1=limitador-operator
LABEL operators.operatorframework.io.bundle.channels.v1=alpha
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.28.1
LABEL operators.operatorframework.io.metrics.builder=operator-sdk-v1.22.0
LABEL operators.operatorframework.io.metrics.mediatype.v1=metrics+v1
LABEL operators.operatorframework.io.metrics.project_layout=go.kubebuilder.io/v3

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ metadata:
"get_toy == 'yes'"
],
"max_value": 2,
"name": "uselessName",
"namespace": "toystore-app",
"seconds": 30,
"variables": []
Expand All @@ -36,8 +37,7 @@ metadata:
capabilities: Basic Install
categories: Integration & Delivery
containerImage: quay.io/kuadrant/limitador-operator:latest
createdAt: "2023-09-27T14:09:01Z"
operators.operatorframework.io/builder: operator-sdk-v1.28.1
operators.operatorframework.io/builder: operator-sdk-v1.22.0
operators.operatorframework.io/project_layout: go.kubebuilder.io/v3
repository: https://github.com/Kuadrant/limitador-operator
support: kuadrant
Expand Down
113 changes: 50 additions & 63 deletions bundle/manifests/limitador.kuadrant.io_limitadors.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion bundle/metadata/annotations.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ annotations:
operators.operatorframework.io.bundle.metadata.v1: metadata/
operators.operatorframework.io.bundle.package.v1: limitador-operator
operators.operatorframework.io.bundle.channels.v1: alpha
operators.operatorframework.io.metrics.builder: operator-sdk-v1.28.1
operators.operatorframework.io.metrics.builder: operator-sdk-v1.22.0
operators.operatorframework.io.metrics.mediatype.v1: metrics+v1
operators.operatorframework.io.metrics.project_layout: go.kubebuilder.io/v3

Expand Down
116 changes: 55 additions & 61 deletions config/crd/bases/limitador.kuadrant.io_limitadors.yaml

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions config/rbac/role.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

---
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
Expand Down
1 change: 1 addition & 0 deletions config/samples/limitador_v1alpha1_limitador.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ spec:
namespace: toystore-app
seconds: 30
variables: []
name: "uselessName"
1 change: 1 addition & 0 deletions controllers/limitador_controller_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ var _ = Describe("Limitador controller", func() {
Namespace: "test-namespace",
Seconds: 60,
Variables: []string{"user_id"},
Name: "useless",
},
{
Conditions: []string{"req.method == 'POST'"},
Expand Down
1 change: 1 addition & 0 deletions pkg/limitador/k8s_objects_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ func TestLimitsConfigMap(t *testing.T) {
MaxValue: 1000,
Namespace: "my-ns",
Seconds: 60,
Name: "useless",
},
{
Conditions: []string{"cond == '1'"},
Expand Down

0 comments on commit a90c6cb

Please sign in to comment.