2015-08-18 15:03:54 +00:00
|
|
|
/*
|
2016-06-03 00:25:58 +00:00
|
|
|
Copyright 2015 The Kubernetes Authors.
|
2015-08-18 15:03:54 +00:00
|
|
|
|
|
|
|
Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
you may not use this file except in compliance with the License.
|
|
|
|
You may obtain a copy of the License at
|
|
|
|
|
|
|
|
http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
|
|
|
|
Unless required by applicable law or agreed to in writing, software
|
|
|
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
See the License for the specific language governing permissions and
|
|
|
|
limitations under the License.
|
|
|
|
*/
|
|
|
|
|
|
|
|
package registrytest
|
|
|
|
|
|
|
|
import (
|
2015-08-20 09:17:04 +00:00
|
|
|
"testing"
|
|
|
|
|
2017-02-02 09:10:32 +00:00
|
|
|
etcdtesting "k8s.io/apiserver/pkg/storage/etcd/testing"
|
2017-01-26 19:42:01 +00:00
|
|
|
"k8s.io/apiserver/pkg/storage/storagebackend"
|
2015-08-20 09:17:04 +00:00
|
|
|
"k8s.io/kubernetes/pkg/api/testapi"
|
2015-08-18 15:03:54 +00:00
|
|
|
)
|
|
|
|
|
2016-08-08 22:12:54 +00:00
|
|
|
func NewEtcdStorage(t *testing.T, group string) (*storagebackend.Config, *etcdtesting.EtcdTestServer) {
|
2017-10-30 12:18:49 +00:00
|
|
|
server, config := etcdtesting.NewUnsecuredEtcd3TestClientServer(t)
|
2016-08-26 01:38:27 +00:00
|
|
|
config.Codec = testapi.Groups[group].StorageCodec()
|
2016-08-08 22:12:54 +00:00
|
|
|
return config, server
|
2015-08-20 09:17:04 +00:00
|
|
|
}
|