本文整理匯總了Golang中k8s/io/kubernetes/pkg/registry/registrytest.SetObjectsForKey函數的典型用法代碼示例。如果您正苦於以下問題:Golang SetObjectsForKey函數的具體用法?Golang SetObjectsForKey怎麽用?Golang SetObjectsForKey使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了SetObjectsForKey函數的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Golang代碼示例。
示例1: TestEtcdList
func TestEtcdList(t *testing.T) {
storage, fakeClient := newStorage(t)
test := resttest.New(t, storage, fakeClient.SetError)
key := etcdtest.AddPrefix(storage.KeyRootFunc(test.TestContext()))
test.TestList(
validNewDeployment(),
func(objects []runtime.Object) []runtime.Object {
return registrytest.SetObjectsForKey(fakeClient, key, objects)
},
func(resourceVersion uint64) {
registrytest.SetResourceVersion(fakeClient, resourceVersion)
})
}
示例2: TestList
func TestList(t *testing.T) {
storage, fakeClient := newStorage(t)
test := resttest.New(t, storage, fakeClient.SetError)
key := etcdtest.AddPrefix(storage.KeyRootFunc(test.TestContext()))
autoscaler := validNewHorizontalPodAutoscaler("foo")
test.TestList(
autoscaler,
func(objects []runtime.Object) []runtime.Object {
return registrytest.SetObjectsForKey(fakeClient, key, objects)
},
func(resourceVersion uint64) {
registrytest.SetResourceVersion(fakeClient, resourceVersion)
})
}
示例3: TestEtcdListPersistentVolumeClaims
func TestEtcdListPersistentVolumeClaims(t *testing.T) {
storage, _, fakeClient := newStorage(t)
test := resttest.New(t, storage, fakeClient.SetError)
key := etcdtest.AddPrefix(storage.KeyRootFunc(test.TestContext()))
claim := validNewPersistentVolumeClaim("foo", api.NamespaceDefault)
test.TestList(
claim,
func(objects []runtime.Object) []runtime.Object {
return registrytest.SetObjectsForKey(fakeClient, key, objects)
},
func(resourceVersion uint64) {
registrytest.SetResourceVersion(fakeClient, resourceVersion)
})
}
示例4: TestList
func TestList(t *testing.T) {
storage, fakeClient := newStorage(t)
test := resttest.New(t, storage, fakeClient.SetError).ClusterScope()
key := etcdtest.AddPrefix(storage.KeyRootFunc(test.TestContext()))
namespace := validNewNamespace()
test.TestList(
namespace,
func(objects []runtime.Object) []runtime.Object {
return registrytest.SetObjectsForKey(fakeClient, key, objects)
},
func(resourceVersion uint64) {
registrytest.SetResourceVersion(fakeClient, resourceVersion)
})
}
示例5: TestEtcdList
func TestEtcdList(t *testing.T) {
fakeEtcdClient, etcdStorage := newEtcdStorage(t)
storage, _ := NewStorage(etcdStorage)
test := resttest.New(t, storage, fakeEtcdClient.SetError)
key := etcdtest.AddPrefix(storage.Etcd.KeyRootFunc(test.TestContext()))
resourcequota := validNewResourceQuota()
test.TestList(
resourcequota,
func(objects []runtime.Object) []runtime.Object {
return registrytest.SetObjectsForKey(fakeEtcdClient, key, objects)
},
func(resourceVersion uint64) {
registrytest.SetResourceVersion(fakeEtcdClient, resourceVersion)
})
}