mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-19 09:52:49 +00:00
initialize feature gates in test project
This commit is contained in:
parent
a0b1bee7c5
commit
009a2cbbc8
@ -130,6 +130,12 @@ func TestMain(m *testing.M) {
|
||||
fmt.Fprintf(os.Stderr, "ERROR: initialize feature gates: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
if err := services.SetFeatureGatesForInProcessComponents(featureGates); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "ERROR: initialize process feature gates: %v", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
setExtraEnvs()
|
||||
os.Exit(m.Run())
|
||||
}
|
||||
|
@ -23,6 +23,7 @@ import (
|
||||
|
||||
etcd3testing "k8s.io/apiserver/pkg/storage/etcd3/testing"
|
||||
"k8s.io/apiserver/pkg/storage/storagebackend"
|
||||
utilfeature "k8s.io/apiserver/pkg/util/feature"
|
||||
"k8s.io/klog/v2/ktesting"
|
||||
"k8s.io/kubernetes/test/e2e/framework"
|
||||
|
||||
@ -139,3 +140,7 @@ func getServicesHealthCheckURLs() []string {
|
||||
getAPIServerHealthCheckURL(),
|
||||
}
|
||||
}
|
||||
|
||||
func SetFeatureGatesForInProcessComponents(featureGates map[string]bool) error {
|
||||
return utilfeature.DefaultMutableFeatureGate.SetFromMap(featureGates)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user