define some default kube-apiserver flags for tests disabling unneded controllers

This commit is contained in:
Antonio Ojea 2024-06-04 20:55:42 +00:00 committed by Swetha Repakula
parent c09e4b2b0f
commit 9844402a90

View File

@ -98,3 +98,11 @@ func SharedEtcd() *storagebackend.Config {
cfg.Transport.ServerList = []string{GetEtcdURL()}
return cfg
}
// DefaultAPIServerFlags returns the default flags used to run kube-apiserver on tests
func DefaultTestServerFlags() []string {
return []string{
"--endpoint-reconciler-type=none", // Disable Endpoints Reconciler so it does not keep failing trying to use 127.0.0.1 as a valid Endpoint.
"--disable-admission-plugins=ServiceAccount", // Disable ServiceAccount admission plugin as we don't have serviceaccount controller running.
}
}