From 26346bc527629957c2f26742cb1e06b71c9d82e2 Mon Sep 17 00:00:00 2001 From: Iceber Gu Date: Tue, 26 Dec 2023 09:38:06 +0800 Subject: [PATCH] Revert #627 "set the default value of the feature gate APIServerTracing to false" Signed-off-by: Iceber Gu --- cmd/apiserver/app/apiserver.go | 21 +++++-------------- .../clusterpedia_apiserver_deployment.yaml | 3 +-- 2 files changed, 6 insertions(+), 18 deletions(-) diff --git a/cmd/apiserver/app/apiserver.go b/cmd/apiserver/app/apiserver.go index 4ee5535ac..332b9f6b4 100644 --- a/cmd/apiserver/app/apiserver.go +++ b/cmd/apiserver/app/apiserver.go @@ -2,7 +2,6 @@ package app import ( "context" - "fmt" "os" "github.com/spf13/cobra" @@ -68,25 +67,15 @@ func NewClusterPediaServerCommand(ctx context.Context) *cobra.Command { return cmd } -var wrapedDefaultFeatureGate = map[featuregate.Feature]bool{ - // https://github.com/clusterpedia-io/clusterpedia/issues/196 - genericfeatures.RemainingItemCount: false, - - genericfeatures.APIServerTracing: false, -} - func init() { runtime.Must(logsapi.AddFeatureGates(utilfeature.DefaultMutableFeatureGate)) + // The feature gate `RemainingItemCount` should default to false + // https://github.com/clusterpedia-io/clusterpedia/issues/196 gates := utilfeature.DefaultMutableFeatureGate.GetAll() - for feature, value := range wrapedDefaultFeatureGate { - gate, ok := gates[feature] - if !ok { - panic(fmt.Sprintf("FeatureGate[%s] is not existed in the default feature gates", feature)) - } - gate.Default = value - gates[feature] = gate - } + gate := gates[genericfeatures.RemainingItemCount] + gate.Default = false + gates[genericfeatures.RemainingItemCount] = gate utilfeature.DefaultMutableFeatureGate = featuregate.NewFeatureGate() runtime.Must(utilfeature.DefaultMutableFeatureGate.Add(gates)) diff --git a/kustomize/apiserver/clusterpedia_apiserver_deployment.yaml b/kustomize/apiserver/clusterpedia_apiserver_deployment.yaml index bac2e978f..9ef52dfd3 100644 --- a/kustomize/apiserver/clusterpedia_apiserver_deployment.yaml +++ b/kustomize/apiserver/clusterpedia_apiserver_deployment.yaml @@ -42,7 +42,6 @@ spec: - --secure-port=443 - --storage-config=/etc/clusterpedia/storage/internalstorage-config.yaml - --tracing-config-file=/etc/clusterpedia/trace/tracing-config.yaml - - --feature-gates=APIServerTracing=true - -v=3 env: - name: DB_PASSWORD @@ -77,4 +76,4 @@ data: kind: TracingConfiguration # default # endpoint: localhost:4317 - samplingRatePerMillion: 1000000 + samplingRatePerMillion: 1000000 \ No newline at end of file