@@ -17,8 +17,6 @@ limitations under the License.
17
17
package fake
18
18
19
19
import (
20
- "encoding/json"
21
-
22
20
. "github.com/onsi/ginkgo"
23
21
. "github.com/onsi/gomega"
24
22
@@ -68,22 +66,13 @@ var _ = Describe("Fake client", func() {
68
66
69
67
It ("should be able to List" , func () {
70
68
By ("Listing all deployments in a namespace" )
71
- list := & metav1. List {}
69
+ list := & appsv1. DeploymentList {}
72
70
err := cl .List (nil , & client.ListOptions {
73
71
Namespace : "ns1" ,
74
- Raw : & metav1.ListOptions {
75
- TypeMeta : metav1.TypeMeta {
76
- APIVersion : "apps/v1" ,
77
- Kind : "Deployment" ,
78
- },
79
- },
80
72
}, list )
81
73
Expect (err ).To (BeNil ())
82
74
Expect (list .Items ).To (HaveLen (1 ))
83
- j , err := json .Marshal (dep )
84
- Expect (err ).To (BeNil ())
85
- expectedDep := runtime.RawExtension {Raw : j }
86
- Expect (list .Items ).To (ConsistOf (expectedDep ))
75
+ Expect (list .Items ).To (ConsistOf (* dep ))
87
76
})
88
77
89
78
It ("should be able to Create" , func () {
@@ -139,15 +128,9 @@ var _ = Describe("Fake client", func() {
139
128
Expect (err ).To (BeNil ())
140
129
141
130
By ("Listing all deployments in the namespace" )
142
- list := & metav1. List {}
131
+ list := & appsv1. DeploymentList {}
143
132
err = cl .List (nil , & client.ListOptions {
144
133
Namespace : "ns1" ,
145
- Raw : & metav1.ListOptions {
146
- TypeMeta : metav1.TypeMeta {
147
- APIVersion : "apps/v1" ,
148
- Kind : "Deployment" ,
149
- },
150
- },
151
134
}, list )
152
135
Expect (err ).To (BeNil ())
153
136
Expect (list .Items ).To (HaveLen (0 ))
0 commit comments