From 711c1e17209cc410440eecd3723e7b4906ca0e42 Mon Sep 17 00:00:00 2001 From: Jonathan Tomer Date: Thu, 27 Feb 2020 14:04:37 -0800 Subject: [PATCH] Rename --enable-inflight-quota-handler to --enable-priority-and-fairness. The old flag name doesn't make sense with the renamed API Priority and Fairness feature, and it's still safe to change the flag since it hasn't done anything useful in a released k8s version yet. --- cmd/kube-apiserver/app/options/options_test.go | 2 +- cmd/kube-apiserver/app/server.go | 2 +- .../apiserver/pkg/server/options/server_run_options.go | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/cmd/kube-apiserver/app/options/options_test.go b/cmd/kube-apiserver/app/options/options_test.go index d0be904a97b..9afed6eb875 100644 --- a/cmd/kube-apiserver/app/options/options_test.go +++ b/cmd/kube-apiserver/app/options/options_test.go @@ -98,7 +98,7 @@ func TestAddFlags(t *testing.T) { "--contention-profiling=true", "--egress-selector-config-file=/var/run/kubernetes/egress-selector/connectivity.yaml", "--enable-aggregator-routing=true", - "--enable-inflight-quota-handler=false", + "--enable-priority-and-fairness=false", "--enable-logs-handler=false", "--endpoint-reconciler-type=" + string(reconcilers.LeaseEndpointReconcilerType), "--etcd-keyfile=/var/run/kubernetes/etcd.key", diff --git a/cmd/kube-apiserver/app/server.go b/cmd/kube-apiserver/app/server.go index 6c58e076515..25b1c366e87 100644 --- a/cmd/kube-apiserver/app/server.go +++ b/cmd/kube-apiserver/app/server.go @@ -552,7 +552,7 @@ func buildGenericConfig( lastErr = fmt.Errorf("failed to initialize admission: %v", err) } - if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIPriorityAndFairness) && s.GenericServerRunOptions.EnableInflightQuotaHandler { + if utilfeature.DefaultFeatureGate.Enabled(genericfeatures.APIPriorityAndFairness) && s.GenericServerRunOptions.EnablePriorityAndFairness { genericConfig.FlowControl = BuildPriorityAndFairness(s, clientgoExternalClient, versionedInformers) } diff --git a/staging/src/k8s.io/apiserver/pkg/server/options/server_run_options.go b/staging/src/k8s.io/apiserver/pkg/server/options/server_run_options.go index 9645ece1d38..3cb8964bb2e 100644 --- a/staging/src/k8s.io/apiserver/pkg/server/options/server_run_options.go +++ b/staging/src/k8s.io/apiserver/pkg/server/options/server_run_options.go @@ -48,9 +48,9 @@ type ServerRunOptions struct { // decoded in a write request. 0 means no limit. // We intentionally did not add a flag for this option. Users of the // apiserver library can wire it to a flag. - MaxRequestBodyBytes int64 - TargetRAMMB int - EnableInflightQuotaHandler bool + MaxRequestBodyBytes int64 + TargetRAMMB int + EnablePriorityAndFairness bool } func NewServerRunOptions() *ServerRunOptions { @@ -64,7 +64,7 @@ func NewServerRunOptions() *ServerRunOptions { ShutdownDelayDuration: defaults.ShutdownDelayDuration, JSONPatchMaxCopyBytes: defaults.JSONPatchMaxCopyBytes, MaxRequestBodyBytes: defaults.MaxRequestBodyBytes, - EnableInflightQuotaHandler: true, + EnablePriorityAndFairness: true, } } @@ -193,7 +193,7 @@ func (s *ServerRunOptions) AddUniversalFlags(fs *pflag.FlagSet) { "handler, which picks a randomized value above this number as the connection timeout, "+ "to spread out load.") - fs.BoolVar(&s.EnableInflightQuotaHandler, "enable-inflight-quota-handler", s.EnableInflightQuotaHandler, ""+ + fs.BoolVar(&s.EnablePriorityAndFairness, "enable-priority-and-fairness", s.EnablePriorityAndFairness, ""+ "If true and the APIPriorityAndFairness feature gate is enabled, replace the max-in-flight handler with an enhanced one that queues and dispatches with priority and fairness") fs.DurationVar(&s.ShutdownDelayDuration, "shutdown-delay-duration", s.ShutdownDelayDuration, ""+