mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-05 15:37:24 +00:00
FIXUP: cmd/kube-apiserver/app/options: split apart controlplane part
This commit is contained in:
@@ -127,30 +127,30 @@ func StartTestServer(ctx context.Context, t testing.TB, setup TestServerSetup) (
|
||||
t.Fatalf("write file %s failed: %v", saSigningKeyFile.Name(), err)
|
||||
}
|
||||
|
||||
kubeAPIServerOptions := options.NewServerRunOptions()
|
||||
kubeAPIServerOptions.SecureServing.Listener = listener
|
||||
kubeAPIServerOptions.SecureServing.BindAddress = netutils.ParseIPSloppy("127.0.0.1")
|
||||
kubeAPIServerOptions.SecureServing.ServerCert.CertDirectory = certDir
|
||||
kubeAPIServerOptions.ServiceAccountSigningKeyFile = saSigningKeyFile.Name()
|
||||
kubeAPIServerOptions.Etcd.StorageConfig.Prefix = path.Join("/", uuid.New().String(), "registry")
|
||||
kubeAPIServerOptions.Etcd.StorageConfig.Transport.ServerList = []string{GetEtcdURL()}
|
||||
kubeAPIServerOptions.ServiceClusterIPRanges = defaultServiceClusterIPRange.String()
|
||||
kubeAPIServerOptions.Authentication.RequestHeader.UsernameHeaders = []string{"X-Remote-User"}
|
||||
kubeAPIServerOptions.Authentication.RequestHeader.GroupHeaders = []string{"X-Remote-Group"}
|
||||
kubeAPIServerOptions.Authentication.RequestHeader.ExtraHeaderPrefixes = []string{"X-Remote-Extra-"}
|
||||
kubeAPIServerOptions.Authentication.RequestHeader.AllowedNames = []string{"kube-aggregator"}
|
||||
kubeAPIServerOptions.Authentication.RequestHeader.ClientCAFile = proxyCACertFile.Name()
|
||||
kubeAPIServerOptions.Authentication.APIAudiences = []string{"https://foo.bar.example.com"}
|
||||
kubeAPIServerOptions.Authentication.ServiceAccounts.Issuers = []string{"https://foo.bar.example.com"}
|
||||
kubeAPIServerOptions.Authentication.ServiceAccounts.KeyFiles = []string{saSigningKeyFile.Name()}
|
||||
kubeAPIServerOptions.Authentication.ClientCert.ClientCA = clientCACertFile.Name()
|
||||
kubeAPIServerOptions.Authorization.Modes = []string{"Node", "RBAC"}
|
||||
opts := options.NewServerRunOptions()
|
||||
opts.SecureServing.Listener = listener
|
||||
opts.SecureServing.BindAddress = netutils.ParseIPSloppy("127.0.0.1")
|
||||
opts.SecureServing.ServerCert.CertDirectory = certDir
|
||||
opts.ServiceAccountSigningKeyFile = saSigningKeyFile.Name()
|
||||
opts.Etcd.StorageConfig.Prefix = path.Join("/", uuid.New().String(), "registry")
|
||||
opts.Etcd.StorageConfig.Transport.ServerList = []string{GetEtcdURL()}
|
||||
opts.ServiceClusterIPRanges = defaultServiceClusterIPRange.String()
|
||||
opts.Authentication.RequestHeader.UsernameHeaders = []string{"X-Remote-User"}
|
||||
opts.Authentication.RequestHeader.GroupHeaders = []string{"X-Remote-Group"}
|
||||
opts.Authentication.RequestHeader.ExtraHeaderPrefixes = []string{"X-Remote-Extra-"}
|
||||
opts.Authentication.RequestHeader.AllowedNames = []string{"kube-aggregator"}
|
||||
opts.Authentication.RequestHeader.ClientCAFile = proxyCACertFile.Name()
|
||||
opts.Authentication.APIAudiences = []string{"https://foo.bar.example.com"}
|
||||
opts.Authentication.ServiceAccounts.Issuers = []string{"https://foo.bar.example.com"}
|
||||
opts.Authentication.ServiceAccounts.KeyFiles = []string{saSigningKeyFile.Name()}
|
||||
opts.Authentication.ClientCert.ClientCA = clientCACertFile.Name()
|
||||
opts.Authorization.Modes = []string{"Node", "RBAC"}
|
||||
|
||||
if setup.ModifyServerRunOptions != nil {
|
||||
setup.ModifyServerRunOptions(kubeAPIServerOptions)
|
||||
setup.ModifyServerRunOptions(opts)
|
||||
}
|
||||
|
||||
completedOptions, err := options.Complete(kubeAPIServerOptions)
|
||||
completedOptions, err := opts.Complete()
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user