mirror of
https://github.com/kubernetes/client-go.git
synced 2025-09-06 09:30:56 +00:00
published by bot
(https://github.com/kubernetes/contrib/tree/master/mungegithub) copied from https://github.com/kubernetes/kubernetes.git, branch master, last commit is 124fb610dcbd445fa710da67508ac6d5b822f61d
This commit is contained in:
13
tools/cache/testing/fake_controller_source.go
vendored
13
tools/cache/testing/fake_controller_source.go
vendored
@@ -24,6 +24,7 @@ import (
|
||||
|
||||
"k8s.io/client-go/pkg/api"
|
||||
"k8s.io/client-go/pkg/api/meta"
|
||||
"k8s.io/client-go/pkg/api/v1"
|
||||
"k8s.io/client-go/pkg/runtime"
|
||||
"k8s.io/client-go/pkg/types"
|
||||
"k8s.io/client-go/pkg/watch"
|
||||
@@ -161,7 +162,7 @@ func (f *FakeControllerSource) getListItemsLocked() ([]runtime.Object, error) {
|
||||
}
|
||||
|
||||
// List returns a list object, with its resource version set.
|
||||
func (f *FakeControllerSource) List(options api.ListOptions) (runtime.Object, error) {
|
||||
func (f *FakeControllerSource) List(options v1.ListOptions) (runtime.Object, error) {
|
||||
f.lock.RLock()
|
||||
defer f.lock.RUnlock()
|
||||
list, err := f.getListItemsLocked()
|
||||
@@ -182,14 +183,14 @@ func (f *FakeControllerSource) List(options api.ListOptions) (runtime.Object, er
|
||||
}
|
||||
|
||||
// List returns a list object, with its resource version set.
|
||||
func (f *FakePVControllerSource) List(options api.ListOptions) (runtime.Object, error) {
|
||||
func (f *FakePVControllerSource) List(options v1.ListOptions) (runtime.Object, error) {
|
||||
f.lock.RLock()
|
||||
defer f.lock.RUnlock()
|
||||
list, err := f.FakeControllerSource.getListItemsLocked()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listObj := &api.PersistentVolumeList{}
|
||||
listObj := &v1.PersistentVolumeList{}
|
||||
if err := meta.SetList(listObj, list); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -203,14 +204,14 @@ func (f *FakePVControllerSource) List(options api.ListOptions) (runtime.Object,
|
||||
}
|
||||
|
||||
// List returns a list object, with its resource version set.
|
||||
func (f *FakePVCControllerSource) List(options api.ListOptions) (runtime.Object, error) {
|
||||
func (f *FakePVCControllerSource) List(options v1.ListOptions) (runtime.Object, error) {
|
||||
f.lock.RLock()
|
||||
defer f.lock.RUnlock()
|
||||
list, err := f.FakeControllerSource.getListItemsLocked()
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
listObj := &api.PersistentVolumeClaimList{}
|
||||
listObj := &v1.PersistentVolumeClaimList{}
|
||||
if err := meta.SetList(listObj, list); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -225,7 +226,7 @@ func (f *FakePVCControllerSource) List(options api.ListOptions) (runtime.Object,
|
||||
|
||||
// Watch returns a watch, which will be pre-populated with all changes
|
||||
// after resourceVersion.
|
||||
func (f *FakeControllerSource) Watch(options api.ListOptions) (watch.Interface, error) {
|
||||
func (f *FakeControllerSource) Watch(options v1.ListOptions) (watch.Interface, error) {
|
||||
f.lock.RLock()
|
||||
defer f.lock.RUnlock()
|
||||
rc, err := strconv.Atoi(options.ResourceVersion)
|
||||
|
Reference in New Issue
Block a user