mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-29 21:29:24 +00:00
Merge pull request #33927 from deads2k/api-21-fix-improper-eviction
Automatic merge from submit-queue fix pod eviction storage Refactor pod eviction storage to remove the tight order coupling of the storage. This also gets us ready to deal with cases where API groups are not co-located on the same server, though the particular client being used would assume a proxy.
This commit is contained in:
@@ -81,7 +81,6 @@ import (
|
||||
storagerest "k8s.io/kubernetes/pkg/registry/storage/rest"
|
||||
|
||||
// direct etcd registry dependencies
|
||||
podetcd "k8s.io/kubernetes/pkg/registry/core/pod/etcd"
|
||||
"k8s.io/kubernetes/pkg/registry/extensions/thirdpartyresourcedata"
|
||||
thirdpartyresourcedataetcd "k8s.io/kubernetes/pkg/registry/extensions/thirdpartyresourcedata/etcd"
|
||||
)
|
||||
@@ -220,6 +219,7 @@ func (c completedConfig) New() (*Master, error) {
|
||||
ServiceClusterIPRange: c.GenericConfig.ServiceClusterIPRange,
|
||||
ServiceNodePortRange: c.GenericConfig.ServiceNodePortRange,
|
||||
ComponentStatusServerFunc: func() map[string]apiserver.Server { return getServersToValidate(c.StorageFactory) },
|
||||
LoopbackClientConfig: c.GenericConfig.LoopbackClientConfig,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -328,19 +328,6 @@ func (m *Master) InstallAPIs(c *Config) {
|
||||
}
|
||||
}
|
||||
|
||||
// This is here so that, if the policy group is present, the eviction
|
||||
// subresource handler wil be able to find poddisruptionbudgets
|
||||
// TODO(lavalamp) find a better way for groups to discover and interact
|
||||
// with each other
|
||||
if group == "policy" {
|
||||
storage := apiGroupsInfo[0].VersionedResourcesStorageMap["v1"]["pods/eviction"]
|
||||
evictionStorage := storage.(*podetcd.EvictionREST)
|
||||
|
||||
storage = apiGroupInfo.VersionedResourcesStorageMap["v1alpha1"]["poddisruptionbudgets"]
|
||||
evictionStorage.PodDisruptionBudgetLister = storage.(rest.Lister)
|
||||
evictionStorage.PodDisruptionBudgetUpdater = storage.(rest.Updater)
|
||||
}
|
||||
|
||||
apiGroupsInfo = append(apiGroupsInfo, apiGroupInfo)
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ import (
|
||||
"k8s.io/kubernetes/pkg/apis/extensions"
|
||||
extensionsapiv1beta1 "k8s.io/kubernetes/pkg/apis/extensions/v1beta1"
|
||||
"k8s.io/kubernetes/pkg/apis/rbac"
|
||||
"k8s.io/kubernetes/pkg/client/restclient"
|
||||
"k8s.io/kubernetes/pkg/generated/openapi"
|
||||
"k8s.io/kubernetes/pkg/genericapiserver"
|
||||
"k8s.io/kubernetes/pkg/kubelet/client"
|
||||
@@ -95,6 +96,7 @@ func setUp(t *testing.T) (*Master, *etcdtesting.EtcdTestServer, Config, *assert.
|
||||
config.GenericConfig.ProxyTLSClientConfig = &tls.Config{}
|
||||
config.GenericConfig.RequestContextMapper = api.NewRequestContextMapper()
|
||||
config.GenericConfig.EnableVersion = true
|
||||
config.GenericConfig.LoopbackClientConfig = &restclient.Config{APIPath: "/api", ContentConfig: restclient.ContentConfig{NegotiatedSerializer: api.Codecs}}
|
||||
config.EnableCoreControllers = false
|
||||
|
||||
// TODO: this is kind of hacky. The trouble is that the sync loop
|
||||
|
||||
Reference in New Issue
Block a user