From 1bf11f655db63a2f09cf97f2e64c9c70c816e469 Mon Sep 17 00:00:00 2001 From: Sambhav Kothari Date: Wed, 21 Aug 2024 20:57:25 +0100 Subject: [PATCH] Set default watch progress interval to 5s to ensure appropriate k8s support Signed-off-by: Sambhav Kothari --- main.go | 8 ++++---- pkg/server/maintenance.go | 2 +- pkg/server/server.go | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/main.go b/main.go index 351fdec6..a1ccc789 100644 --- a/main.go +++ b/main.go @@ -98,15 +98,15 @@ func main() { }, &cli.DurationFlag{ Name: "watch-progress-notify-interval", - Usage: "Interval between periodic watch progress notifications. Default is 10m.", + Usage: "Interval between periodic watch progress notifications. Default is 5s to ensure support for watch progress notifications.", Destination: &config.NotifyInterval, - Value: time.Minute * 10, + Value: time.Second * 5, }, &cli.StringFlag{ Name: "emulated-etcd-version", - Usage: "The emulated etcd version to return on a call to the status endpoint. Defaults to 3.4.31 which is the least version that support Kubernetes watch progress feature.", + Usage: "The emulated etcd version to return on a call to the status endpoint. Defaults to 3.5.13, in order to indicate support for watch progress notifications.", Destination: &config.EmulatedETCDVersion, - Value: "3.4.31", + Value: "3.5.13", }, &cli.BoolFlag{Name: "debug"}, } diff --git a/pkg/server/maintenance.go b/pkg/server/maintenance.go index 2198cefe..da0aff41 100644 --- a/pkg/server/maintenance.go +++ b/pkg/server/maintenance.go @@ -22,7 +22,7 @@ func (s *KVServerBridge) Status(ctx context.Context, r *etcdserverpb.StatusReque return &etcdserverpb.StatusResponse{ Header: &etcdserverpb.ResponseHeader{}, DbSize: size, - Version: s.EmulatedETCDVersion, + Version: s.emulatedETCDVersion, }, nil } diff --git a/pkg/server/server.go b/pkg/server/server.go index af0ad7ed..1c42ce66 100644 --- a/pkg/server/server.go +++ b/pkg/server/server.go @@ -11,18 +11,18 @@ import ( ) type KVServerBridge struct { + emulatedETCDVersion string limited *LimitedServer - EmulatedETCDVersion string } func New(backend Backend, scheme string, notifyInterval time.Duration, emulatedETCDVersion string) *KVServerBridge { return &KVServerBridge{ + emulatedETCDVersion: emulatedETCDVersion, limited: &LimitedServer{ notifyInterval: notifyInterval, backend: backend, scheme: scheme, }, - EmulatedETCDVersion: emulatedETCDVersion, } }