mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-04 23:17:50 +00:00
Switch to versioned ListOptions in client.
This commit is contained in:
@@ -22,7 +22,6 @@ import (
|
||||
"k8s.io/kubernetes/pkg/api"
|
||||
"k8s.io/kubernetes/pkg/api/errors"
|
||||
"k8s.io/kubernetes/pkg/api/testapi"
|
||||
"k8s.io/kubernetes/pkg/api/unversioned"
|
||||
"k8s.io/kubernetes/pkg/runtime"
|
||||
)
|
||||
|
||||
@@ -33,7 +32,7 @@ func TestNewClient(t *testing.T) {
|
||||
}
|
||||
client := &Fake{}
|
||||
client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper()))
|
||||
list, err := client.Services("test").List(unversioned.ListOptions{})
|
||||
list, err := client.Services("test").List(api.ListOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -42,7 +41,7 @@ func TestNewClient(t *testing.T) {
|
||||
}
|
||||
|
||||
// When list is invoked a second time, the same results are returned.
|
||||
list, err = client.Services("test").List(unversioned.ListOptions{})
|
||||
list, err = client.Services("test").List(api.ListOptions{})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
@@ -64,12 +63,12 @@ func TestErrors(t *testing.T) {
|
||||
})
|
||||
client := &Fake{}
|
||||
client.AddReactor("*", "*", ObjectReaction(o, testapi.Default.RESTMapper()))
|
||||
_, err := client.Services("test").List(unversioned.ListOptions{})
|
||||
_, err := client.Services("test").List(api.ListOptions{})
|
||||
if !errors.IsNotFound(err) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
t.Logf("error: %#v", err.(*errors.StatusError).Status())
|
||||
_, err = client.Services("test").List(unversioned.ListOptions{})
|
||||
_, err = client.Services("test").List(api.ListOptions{})
|
||||
if !errors.IsForbidden(err) {
|
||||
t.Fatalf("unexpected error: %v", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user