本文整理匯總了Golang中k8s/io/kubernetes/pkg/registry/registrytest.NewEtcdStorage函數的典型用法代碼示例。如果您正苦於以下問題:Golang NewEtcdStorage函數的具體用法?Golang NewEtcdStorage怎麽用?Golang NewEtcdStorage使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了NewEtcdStorage函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: newFailDeleteStorage
func newFailDeleteStorage(t *testing.T, called *bool) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
restOptions := generic.RESTOptions{StorageConfig: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 3}
storage := NewStorage(restOptions, nil, nil)
storage.Pod.Store.Storage = FailDeletionStorage{storage.Pod.Store.Storage, called}
return storage.Pod, server
}
示例2: newFailDeleteStorage
func newFailDeleteStorage(t *testing.T, called *bool) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
failDeleteStorage := FailDeletionStorage{etcdStorage, called}
restOptions := generic.RESTOptions{failDeleteStorage, generic.UndecoratedStorage, 3}
storage := NewStorage(restOptions, nil, nil)
return storage.Pod, server
}
示例3: newStorage
func newStorage(t *testing.T) (*REST, *StatusREST, *InternalREST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, latest.Version.Group)
imageStorage, statusStorage, internalStorage, err := NewREST(restoptions.NewSimpleGetter(etcdStorage), noDefaultRegistry, &fakeSubjectAccessReviewRegistry{}, &testutil.FakeImageStreamLimitVerifier{})
if err != nil {
t.Fatal(err)
}
return imageStorage, statusStorage, internalStorage, server
}
示例4: newStorage
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, latest.Version.Group)
storage, err := NewREST(restoptions.NewSimpleGetter(etcdStorage))
if err != nil {
t.Fatal(err)
}
return storage, server
}
示例5: newStorage
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
storage, _, _, err := NewREST(restoptions.NewSimpleGetter(etcdStorage), testclient.NewSimpleFake())
if err != nil {
t.Fatal(err)
}
return storage, server
}
示例6: newStorage
func newStorage(t *testing.T, allocator routetypes.RouteAllocator) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
storage, _, err := NewREST(restoptions.NewSimpleGetter(etcdStorage), allocator)
if err != nil {
t.Fatal(err)
}
return storage, server
}
示例7: newStorage
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, federation.GroupName)
restOptions := generic.RESTOptions{
Storage: etcdStorage,
Decorator: generic.UndecoratedStorage,
DeleteCollectionWorkers: 1}
storage, _ := NewREST(restOptions)
return storage, server
}
示例8: newStorage
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
restOptions := generic.RESTOptions{StorageConfig: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 1}
storage, err := NewStorage(restOptions, kubeletclient.KubeletClientConfig{}, nil)
if err != nil {
t.Fatal(err)
}
return storage.Node, server
}
示例9: newStorage
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
restOptions := generic.RESTOptions{
StorageConfig: etcdStorage,
Decorator: generic.UndecoratedStorage,
DeleteCollectionWorkers: 1,
ResourcePrefix: "endpoints",
}
return NewREST(restOptions), server
}
示例10: newStorage
func newStorage(t *testing.T) (*ScaleREST, *etcdtesting.EtcdTestServer, storage.Interface, factory.DestroyFunc) {
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
restOptions := generic.RESTOptions{StorageConfig: etcdStorage, Decorator: generic.UndecoratedStorage, DeleteCollectionWorkers: 1, ResourcePrefix: "controllers"}
s, d := generic.NewRawStorage(etcdStorage)
destroyFunc := func() {
d()
server.Terminate(t)
}
return NewStorage(restOptions).Scale, server, s, destroyFunc
}
示例11: newStorage
func newStorage(t *testing.T) (*REST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
restOptions := generic.RESTOptions{
StorageConfig: etcdStorage,
Decorator: generic.UndecoratedStorage,
DeleteCollectionWorkers: 1,
ResourcePrefix: "thirdpartyresources",
}
return NewREST(restOptions), server
}
示例12: newStorage
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, autoscaling.GroupName)
restOptions := generic.RESTOptions{
StorageConfig: etcdStorage,
Decorator: generic.UndecoratedStorage,
DeleteCollectionWorkers: 1,
ResourcePrefix: "horizontalpodautoscalers",
}
horizontalPodAutoscalerStorage, statusStorage := NewREST(restOptions)
return horizontalPodAutoscalerStorage, statusStorage, server
}
示例13: newStorage
func newStorage(t *testing.T) (*REST, *BindingREST, *StatusREST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, "")
restOptions := generic.RESTOptions{
StorageConfig: etcdStorage,
Decorator: generic.UndecoratedStorage,
DeleteCollectionWorkers: 3,
ResourcePrefix: "pods",
}
storage := NewStorage(restOptions, nil, nil, nil)
return storage.Pod, storage.Binding, storage.Status, server
}
示例14: newStorage
func newStorage(t *testing.T) (*JobStorage, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, batch.GroupName)
restOptions := generic.RESTOptions{
StorageConfig: etcdStorage,
Decorator: generic.UndecoratedStorage,
DeleteCollectionWorkers: 1,
ResourcePrefix: "jobs",
}
jobStorage := NewStorage(restOptions)
return &jobStorage, server
}
示例15: newStorage
func newStorage(t *testing.T) (*REST, *StatusREST, *etcdtesting.EtcdTestServer) {
etcdStorage, server := registrytest.NewEtcdStorage(t, extensions.GroupName)
restOptions := generic.RESTOptions{
StorageConfig: etcdStorage,
Decorator: generic.UndecoratedStorage,
DeleteCollectionWorkers: 1,
ResourcePrefix: "daemonsets",
}
daemonSetStorage, statusStorage := NewREST(restOptions)
return daemonSetStorage, statusStorage, server
}