Skip to content

Commit 1c4ab58

Browse files
feat: add exponential retry ratelimiter on error (#16)
* feat: add exponential retry rateliter on error * deps: changed with remote
1 parent ef44cc9 commit 1c4ab58

File tree

8 files changed

+117
-215
lines changed

8 files changed

+117
-215
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,14 @@ spec:
8686

8787
The following environment variables can be configured in the rest-dynamic-controller's Deployment:
8888

89-
| Name | Description | Default Value |
90-
|------|-------------|---------------|
89+
| Name | Description | Default Value |
90+
|------|--------------|---------------|
9191
| REST_CONTROLLER_DEBUG | Enable verbose output | `false` |
9292
| REST_CONTROLLER_WORKERS | Number of worker threads | `1` |
9393
| REST_CONTROLLER_RESYNC_INTERVAL | Interval between resyncs | `3m` |
9494
| REST_CONTROLLER_GROUP | Resource API group | - |
9595
| REST_CONTROLLER_VERSION | Resource API version | - |
9696
| REST_CONTROLLER_RESOURCE | Resource plural name | - |
97-
| URL_PLURALS | BFF plurals endpoint | `http://bff.krateo-system.svc.cluster.local:8081/api-info/names` |
97+
| URL_PLURALS | BFF plurals endpoint | `http://snowplow.krateo-system.svc.cluster.local:8081/api-info/names` |
98+
| REST_CONTROLLER_MAX_ERROR_RETRY_INTERVAL | The maximum interval between retries when an error occurs. This should be less than the half of the resync interval. | `30s` |
99+
| REST_CONTROLLER_MIN_ERROR_RETRY_INTERVAL | The minimum interval between retries when an error occurs. This should be less than max-error-retry-interval. | `1s` |

go.mod

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,20 @@
11
module github.com/krateoplatformops/rest-dynamic-controller
22

3-
go 1.23.0
3+
go 1.23.3
4+
5+
toolchain go1.23.4
46

57
require (
6-
github.com/gobuffalo/flect v1.0.2
7-
github.com/krateoplatformops/unstructured-runtime v0.0.9
8+
github.com/gobuffalo/flect v1.0.3
9+
github.com/krateoplatformops/snowplow v0.0.0-20250311104630-6e215130151f
10+
github.com/krateoplatformops/unstructured-runtime v0.1.1
811
github.com/lucasepe/httplib v0.2.2
912
github.com/pb33f/libopenapi v0.16.8
10-
github.com/rs/zerolog v1.32.0
11-
k8s.io/api v0.31.1
12-
k8s.io/apimachinery v0.31.1
13-
k8s.io/client-go v0.31.1
14-
sigs.k8s.io/controller-runtime v0.19.1
13+
github.com/rs/zerolog v1.33.0
14+
k8s.io/api v0.32.1
15+
k8s.io/apimachinery v0.32.1
16+
k8s.io/client-go v0.32.1
17+
sigs.k8s.io/controller-runtime v0.20.0
1518
)
1619

1720
require (
@@ -27,13 +30,11 @@ require (
2730
github.com/go-openapi/jsonreference v0.21.0 // indirect
2831
github.com/go-openapi/swag v0.23.0 // indirect
2932
github.com/gogo/protobuf v1.3.2 // indirect
30-
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
3133
github.com/golang/protobuf v1.5.4 // indirect
3234
github.com/google/gnostic-models v0.6.9-0.20230804172637-c7be7c783f49 // indirect
3335
github.com/google/go-cmp v0.6.0 // indirect
3436
github.com/google/gofuzz v1.2.0 // indirect
3537
github.com/google/uuid v1.6.0 // indirect
36-
github.com/imdario/mergo v0.3.16 // indirect
3738
github.com/josharian/intern v1.0.0 // indirect
3839
github.com/json-iterator/go v1.1.12 // indirect
3940
github.com/mailru/easyjson v0.7.7 // indirect
@@ -42,32 +43,31 @@ require (
4243
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
4344
github.com/modern-go/reflect2 v1.0.2 // indirect
4445
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
46+
github.com/onsi/ginkgo v1.16.5 // indirect
4547
github.com/pkg/errors v0.9.1 // indirect
4648
github.com/spf13/pflag v1.0.5 // indirect
4749
github.com/twmb/murmur3 v1.1.8 // indirect
4850
github.com/vmware-labs/yaml-jsonpath v0.3.2 // indirect
4951
github.com/wk8/go-ordered-map/v2 v2.1.8 // indirect
5052
github.com/x448/float16 v0.8.4 // indirect
5153
go.uber.org/multierr v1.11.0 // indirect
52-
go.uber.org/zap v1.26.0 // indirect
54+
go.uber.org/zap v1.27.0 // indirect
5355
golang.org/x/exp v0.0.0-20240823005443-9b4947da3948 // indirect
54-
golang.org/x/net v0.28.0 // indirect
55-
golang.org/x/oauth2 v0.22.0 // indirect
56-
golang.org/x/sync v0.8.0 // indirect
57-
golang.org/x/sys v0.24.0 // indirect
58-
golang.org/x/term v0.23.0 // indirect
59-
golang.org/x/text v0.17.0 // indirect
56+
golang.org/x/net v0.33.0 // indirect
57+
golang.org/x/oauth2 v0.23.0 // indirect
58+
golang.org/x/sync v0.10.0 // indirect
59+
golang.org/x/sys v0.28.0 // indirect
60+
golang.org/x/term v0.27.0 // indirect
61+
golang.org/x/text v0.21.0 // indirect
6062
golang.org/x/time v0.7.0 // indirect
61-
google.golang.org/protobuf v1.34.2 // indirect
63+
google.golang.org/protobuf v1.35.1 // indirect
6264
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
6365
gopkg.in/inf.v0 v0.9.1 // indirect
64-
gopkg.in/yaml.v2 v2.4.0 // indirect
6566
gopkg.in/yaml.v3 v3.0.1 // indirect
66-
k8s.io/gengo v0.0.0-20240911193312-2b36238f13e9 // indirect
6767
k8s.io/klog/v2 v2.130.1 // indirect
68-
k8s.io/kube-openapi v0.0.0-20240822171749-76de80e0abd9 // indirect
69-
k8s.io/utils v0.0.0-20240821151609-f90d01438635 // indirect
70-
sigs.k8s.io/json v0.0.0-20221116044647-bc3834ca7abd // indirect
71-
sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect
68+
k8s.io/kube-openapi v0.0.0-20241105132330-32ad38e42d3f // indirect
69+
k8s.io/utils v0.0.0-20241104100929-3ea5e8cea738 // indirect
70+
sigs.k8s.io/json v0.0.0-20241010143419-9aa6b5e7a4b3 // indirect
71+
sigs.k8s.io/structured-merge-diff/v4 v4.4.2 // indirect
7272
sigs.k8s.io/yaml v1.4.0 // indirect
7373
)

0 commit comments

Comments
 (0)