Skip to content

Commit fa3c19c

Browse files
authored
Merge pull request #197 from cleverhu/add-features-for-remainingItemCount
Change the default value of the feature gate RemainintItemCount to false
2 parents 0e09a0a + e08a4ae commit fa3c19c

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

cmd/apiserver/app/apiserver.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,12 @@ import (
44
"context"
55

66
"github.com/spf13/cobra"
7+
"k8s.io/apimachinery/pkg/util/runtime"
8+
genericfeatures "k8s.io/apiserver/pkg/features"
79
utilfeature "k8s.io/apiserver/pkg/util/feature"
810
cliflag "k8s.io/component-base/cli/flag"
911
"k8s.io/component-base/cli/globalflag"
12+
"k8s.io/component-base/featuregate"
1013
"k8s.io/component-base/term"
1114

1215
"github.com/clusterpedia-io/clusterpedia/cmd/apiserver/app/options"
@@ -60,3 +63,16 @@ func NewClusterPediaServerCommand(ctx context.Context) *cobra.Command {
6063
cliflag.SetUsageAndHelpFunc(cmd, namedFlagSets, cols)
6164
return cmd
6265
}
66+
67+
func init() {
68+
// The feature gate `RemainingItemCount` should default to false
69+
// https://github.com/clusterpedia-io/clusterpedia/issues/196
70+
gates := utilfeature.DefaultMutableFeatureGate.GetAll()
71+
gate := gates[genericfeatures.RemainingItemCount]
72+
gate.Default = false
73+
gates[genericfeatures.RemainingItemCount] = gate
74+
75+
utilfeature.DefaultMutableFeatureGate = featuregate.NewFeatureGate()
76+
runtime.Must(utilfeature.DefaultMutableFeatureGate.Add(gates))
77+
utilfeature.DefaultFeatureGate = utilfeature.DefaultMutableFeatureGate
78+
}

0 commit comments

Comments
 (0)