mirror of
https://github.com/kubernetes/client-go.git
synced 2025-06-25 14:41:53 +00:00
remove ListMetaFor
Kubernetes-commit: 7df37c484dac3438530f2b8cb03cf63f85f2fc29
This commit is contained in:
parent
623dbc3dc4
commit
dcd132623d
12
tools/cache/testing/fake_controller_source.go
vendored
12
tools/cache/testing/fake_controller_source.go
vendored
@ -174,12 +174,12 @@ func (f *FakeControllerSource) List(options metav1.ListOptions) (runtime.Object,
|
||||
if err := meta.SetList(listObj, list); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objMeta, err := metav1.ListMetaFor(listObj)
|
||||
listAccessor, err := meta.ListAccessor(listObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resourceVersion := len(f.changes)
|
||||
objMeta.ResourceVersion = strconv.Itoa(resourceVersion)
|
||||
listAccessor.SetResourceVersion(strconv.Itoa(resourceVersion))
|
||||
return listObj, nil
|
||||
}
|
||||
|
||||
@ -195,12 +195,12 @@ func (f *FakePVControllerSource) List(options metav1.ListOptions) (runtime.Objec
|
||||
if err := meta.SetList(listObj, list); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objMeta, err := metav1.ListMetaFor(listObj)
|
||||
listAccessor, err := meta.ListAccessor(listObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resourceVersion := len(f.changes)
|
||||
objMeta.ResourceVersion = strconv.Itoa(resourceVersion)
|
||||
listAccessor.SetResourceVersion(strconv.Itoa(resourceVersion))
|
||||
return listObj, nil
|
||||
}
|
||||
|
||||
@ -216,12 +216,12 @@ func (f *FakePVCControllerSource) List(options metav1.ListOptions) (runtime.Obje
|
||||
if err := meta.SetList(listObj, list); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
objMeta, err := metav1.ListMetaFor(listObj)
|
||||
listAccessor, err := meta.ListAccessor(listObj)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
resourceVersion := len(f.changes)
|
||||
objMeta.ResourceVersion = strconv.Itoa(resourceVersion)
|
||||
listAccessor.SetResourceVersion(strconv.Itoa(resourceVersion))
|
||||
return listObj, nil
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user