From ee2c906b051168ef1c57e56466408dc4834532cf Mon Sep 17 00:00:00 2001 From: Abu Kashem Date: Fri, 27 Aug 2021 10:29:37 -0400 Subject: [PATCH] apiserver: remove server option startup-send-retry-after-until-ready Kubernetes-commit: 7adc79a4ea33cc44aa8d694c4949e01219e016de --- pkg/server/options/server_run_options.go | 36 +++++++----------------- 1 file changed, 10 insertions(+), 26 deletions(-) diff --git a/pkg/server/options/server_run_options.go b/pkg/server/options/server_run_options.go index aebabbd76..07a887a53 100644 --- a/pkg/server/options/server_run_options.go +++ b/pkg/server/options/server_run_options.go @@ -63,31 +63,21 @@ type ServerRunOptions struct { // If enabled, after ShutdownDelayDuration elapses, any incoming request is // rejected with a 429 status code and a 'Retry-After' response. ShutdownSendRetryAfter bool - - // StartupSendRetryAfterUntilReady once set will reject incoming requests with - // a 429 status code and a 'Retry-After' response header until the apiserver - // hasn't fully initialized. - // This option ensures that the system stays consistent even when requests - // are received before the server has been initialized. - // In particular, it prevents child deletion in case of GC or/and orphaned - // content in case of the namespaces controller. - StartupSendRetryAfterUntilReady bool } func NewServerRunOptions() *ServerRunOptions { defaults := server.NewConfig(serializer.CodecFactory{}) return &ServerRunOptions{ - MaxRequestsInFlight: defaults.MaxRequestsInFlight, - MaxMutatingRequestsInFlight: defaults.MaxMutatingRequestsInFlight, - RequestTimeout: defaults.RequestTimeout, - LivezGracePeriod: defaults.LivezGracePeriod, - MinRequestTimeout: defaults.MinRequestTimeout, - ShutdownDelayDuration: defaults.ShutdownDelayDuration, - JSONPatchMaxCopyBytes: defaults.JSONPatchMaxCopyBytes, - MaxRequestBodyBytes: defaults.MaxRequestBodyBytes, - EnablePriorityAndFairness: true, - ShutdownSendRetryAfter: false, - StartupSendRetryAfterUntilReady: false, + MaxRequestsInFlight: defaults.MaxRequestsInFlight, + MaxMutatingRequestsInFlight: defaults.MaxMutatingRequestsInFlight, + RequestTimeout: defaults.RequestTimeout, + LivezGracePeriod: defaults.LivezGracePeriod, + MinRequestTimeout: defaults.MinRequestTimeout, + ShutdownDelayDuration: defaults.ShutdownDelayDuration, + JSONPatchMaxCopyBytes: defaults.JSONPatchMaxCopyBytes, + MaxRequestBodyBytes: defaults.MaxRequestBodyBytes, + EnablePriorityAndFairness: true, + ShutdownSendRetryAfter: false, } } @@ -107,7 +97,6 @@ func (s *ServerRunOptions) ApplyTo(c *server.Config) error { c.MaxRequestBodyBytes = s.MaxRequestBodyBytes c.PublicAddress = s.AdvertiseAddress c.ShutdownSendRetryAfter = s.ShutdownSendRetryAfter - c.StartupSendRetryAfterUntilReady = s.StartupSendRetryAfterUntilReady return nil } @@ -272,10 +261,5 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) { "during this window all incoming requests will be rejected with a status code 429 and a 'Retry-After' response header, "+ "in addition 'Connection: close' response header is set in order to tear down the TCP connection when idle.") - fs.BoolVar(&s.StartupSendRetryAfterUntilReady, "startup-send-retry-after-until-ready", s.ShutdownSendRetryAfter, ""+ - "If true, incoming request(s) will be rejected with a '429' status code and a 'Retry-After' response header "+ - "until the apiserver has initialized. This option ensures that the system stays consistent even when requests "+ - "arrive at the server before it has been initialized.") - utilfeature.DefaultMutableFeatureGate.AddFlag(fs) }