mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-15 06:01:50 +00:00
Allow server and client to take api version as argument
* Defaults to v1beta1 * apiserver takes -storage_version which controls etcd storage version and the version of the client used to connect to other apiservers * Changed signature of client.New to add version parameter * All controller code and component code prefers the oldest (most common) server version
This commit is contained in:
@@ -21,7 +21,6 @@ import (
|
||||
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api"
|
||||
etcderr "github.com/GoogleCloudPlatform/kubernetes/pkg/api/errors/etcd"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/api/latest"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/constraint"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/labels"
|
||||
"github.com/GoogleCloudPlatform/kubernetes/pkg/runtime"
|
||||
@@ -42,13 +41,9 @@ type Registry struct {
|
||||
}
|
||||
|
||||
// NewRegistry creates an etcd registry.
|
||||
func NewRegistry(client tools.EtcdClient) *Registry {
|
||||
func NewRegistry(helper tools.EtcdHelper) *Registry {
|
||||
registry := &Registry{
|
||||
EtcdHelper: tools.EtcdHelper{
|
||||
client,
|
||||
latest.Codec,
|
||||
latest.ResourceVersioner,
|
||||
},
|
||||
EtcdHelper: helper,
|
||||
}
|
||||
registry.manifestFactory = &BasicManifestFactory{
|
||||
serviceRegistry: registry,
|
||||
|
@@ -32,7 +32,7 @@ import (
|
||||
)
|
||||
|
||||
func NewTestEtcdRegistry(client tools.EtcdClient) *Registry {
|
||||
registry := NewRegistry(client)
|
||||
registry := NewRegistry(tools.EtcdHelper{client, latest.Codec, latest.ResourceVersioner})
|
||||
registry.manifestFactory = &BasicManifestFactory{
|
||||
serviceRegistry: ®istrytest.ServiceRegistry{},
|
||||
}
|
||||
|
Reference in New Issue
Block a user