mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
Revert "Merge pull request #104630 from tkashem/remove-option"
This reverts commitedb0a72cff
, reversing changes made to80feff6f40
.
This commit is contained in:
parent
9dba11d971
commit
8844d3092a
@ -63,6 +63,15 @@ type ServerRunOptions struct {
|
|||||||
// If enabled, after ShutdownDelayDuration elapses, any incoming request is
|
// If enabled, after ShutdownDelayDuration elapses, any incoming request is
|
||||||
// rejected with a 429 status code and a 'Retry-After' response.
|
// rejected with a 429 status code and a 'Retry-After' response.
|
||||||
ShutdownSendRetryAfter bool
|
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 {
|
func NewServerRunOptions() *ServerRunOptions {
|
||||||
@ -78,6 +87,7 @@ func NewServerRunOptions() *ServerRunOptions {
|
|||||||
MaxRequestBodyBytes: defaults.MaxRequestBodyBytes,
|
MaxRequestBodyBytes: defaults.MaxRequestBodyBytes,
|
||||||
EnablePriorityAndFairness: true,
|
EnablePriorityAndFairness: true,
|
||||||
ShutdownSendRetryAfter: false,
|
ShutdownSendRetryAfter: false,
|
||||||
|
StartupSendRetryAfterUntilReady: false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -97,6 +107,7 @@ func (s *ServerRunOptions) ApplyTo(c *server.Config) error {
|
|||||||
c.MaxRequestBodyBytes = s.MaxRequestBodyBytes
|
c.MaxRequestBodyBytes = s.MaxRequestBodyBytes
|
||||||
c.PublicAddress = s.AdvertiseAddress
|
c.PublicAddress = s.AdvertiseAddress
|
||||||
c.ShutdownSendRetryAfter = s.ShutdownSendRetryAfter
|
c.ShutdownSendRetryAfter = s.ShutdownSendRetryAfter
|
||||||
|
c.StartupSendRetryAfterUntilReady = s.StartupSendRetryAfterUntilReady
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
@ -261,5 +272,10 @@ 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, "+
|
"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.")
|
"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)
|
utilfeature.DefaultMutableFeatureGate.AddFlag(fs)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user