feat: add support for disabling route polling - #3722
Conversation
Deployment ChecklistThis change falls under the deployment policy. 💁 Since Nov 10th, we are in the RED deployment zone. This means all changes released to production must adhere to the following requirements:
👉 Regardless of which boxes you click in this comment, merge/deployment will not be blocked. |
|
I think we should not use 0, but maybe -1 |
|
|
||
| // ensure a non-zero poll timeout | ||
| if o.SourcePollTimeout <= 0 { | ||
| if o.SourcePollTimeout < 0 { |
There was a problem hiding this comment.
The default is already int64(3000) it's what we use now. We only update to use the default in case of invalid input like 0 or negative
| flag.StringVar(&cfg.InlineRoutes, "inline-routes", "", "inline routes in eskip format") | ||
| flag.StringVar(&cfg.ForwardBackendURL, "forward-backend-url", "", "target url of the <forward> backend") | ||
| flag.Int64Var(&cfg.SourcePollTimeout, "source-poll-timeout", int64(3000), "polling timeout of the routing data sources, in milliseconds") | ||
| flag.Int64Var(&cfg.SourcePollTimeout, "source-poll-timeout", int64(3000), "polling timeout of the routing data sources, in milliseconds. Use 0 to not poll routes.") |
There was a problem hiding this comment.
This is not enough to create a default other than 0
There was a problem hiding this comment.
Why not enough?
szuecs
left a comment
There was a problem hiding this comment.
Disable on <0 and 0 is default, which sets our chosen default.
- Add ability to disable route polling by setting source-poll-timeout to 0 - Return HTTP 204 No Content when polling is disabled Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
… is because 0 will override routing.Options and most tests will fail Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
a03cb0f to
2605b4c
Compare
This allows k8s dataclient to run without loading routing table (which won't call apisever), this will allow us to use k8s dataclient in webhook mode to enable some filters without calling apiserver and may allow us later to get redis endpoints wihout calling routeSRV. This should replace #3722 which disable polling routing across all dataclients which maybe not desriable.
This allows k8s dataclient to run without loading routing table (which won't call apisever), this will allow us to use k8s dataclient in webhook mode to enable some filters without calling apiserver and may allow us later to get redis endpoints wihout calling routeSRV. This should replace #3722 which disable polling routing across all dataclients which maybe not desriable. Signed-off-by: Mustafa Abdelrahman <mustafa.abdelrahman@zalando.de>
|
close in favor of #3729 |
This will help with running
skipperbinary in webhook mode as we need to use-kubernetesflag to enable some filter registries but we don't want skipper to overload/pull data from k8s apiserver