Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
"set the default value of the feature gate APIServerTracing to false"

Signed-off-by: Iceber Gu <caiwei95@hotmail.com>
  • Loading branch information
Iceber committed Dec 26, 2023
1 parent 9843262 commit 26346bc
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 18 deletions.
21 changes: 5 additions & 16 deletions cmd/apiserver/app/apiserver.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ package app

import (
"context"
"fmt"
"os"

"github.com/spf13/cobra"
Expand Down Expand Up @@ -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))
Expand Down
3 changes: 1 addition & 2 deletions kustomize/apiserver/clusterpedia_apiserver_deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -77,4 +76,4 @@ data:
kind: TracingConfiguration
# default
# endpoint: localhost:4317
samplingRatePerMillion: 1000000
samplingRatePerMillion: 1000000

0 comments on commit 26346bc

Please sign in to comment.