mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-10-22 06:59:03 +00:00
k8s.io/apiserver: straighten EtcdOptions, backend Config and kube RESTOptionsFactory
This commit is contained in:
@@ -23,6 +23,7 @@ import (
|
||||
|
||||
utilnet "k8s.io/apimachinery/pkg/util/net"
|
||||
genericoptions "k8s.io/apiserver/pkg/server/options"
|
||||
"k8s.io/apiserver/pkg/storage/storagebackend"
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/validation"
|
||||
kubeoptions "k8s.io/kubernetes/pkg/kubeapiserver/options"
|
||||
@@ -68,7 +69,7 @@ type ServerRunOptions struct {
|
||||
func NewServerRunOptions() *ServerRunOptions {
|
||||
s := ServerRunOptions{
|
||||
GenericServerRunOptions: genericoptions.NewServerRunOptions(),
|
||||
Etcd: genericoptions.NewEtcdOptions(kubeoptions.DefaultEtcdPathPrefix, api.Scheme, nil),
|
||||
Etcd: genericoptions.NewEtcdOptions(storagebackend.NewDefaultConfig(kubeoptions.DefaultEtcdPathPrefix, api.Scheme, nil)),
|
||||
SecureServing: genericoptions.NewSecureServingOptions(),
|
||||
InsecureServing: genericoptions.NewInsecureServingOptions(),
|
||||
Audit: genericoptions.NewAuditLogOptions(),
|
||||
|
@@ -309,11 +309,9 @@ func Run(s *options.ServerRunOptions) error {
|
||||
sets.NewString("watch", "proxy"),
|
||||
sets.NewString("attach", "exec", "proxy", "log", "portforward"),
|
||||
)
|
||||
genericConfig.RESTOptionsGetter = &kubeapiserver.RESTOptionsFactory{
|
||||
StorageFactory: storageFactory,
|
||||
EnableWatchCache: s.Etcd.EnableWatchCache,
|
||||
EnableGarbageCollection: s.Etcd.EnableGarbageCollection,
|
||||
DeleteCollectionWorkers: s.Etcd.DeleteCollectionWorkers,
|
||||
|
||||
if err := s.Etcd.ApplyWithStorageFactoryTo(storageFactory, genericConfig); err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
config := &master.Config{
|
||||
|
Reference in New Issue
Block a user