@@ -91,7 +91,7 @@ var _ = describe("Thing under test, func() {
91
91
}()
92
92
// creates the Ingress Object
93
93
_ , err := cs.CoreV1 ().Foo (ns).Create (foo)
94
- Expect (err). NotTo ( HaveOccurred () )
94
+ framework. ExpectNoError (err )
95
95
})
96
96
})
97
97
```
@@ -118,7 +118,7 @@ var _ = describe("Thing under test, func() {
118
118
Expect (err2).NotTo (HaveOccurred ())
119
119
}()
120
120
_, err = cs.CoreV1 ().Pods (ns).Create (pod)
121
- Expect (err). NotTo ( HaveOccurred () )
121
+ framework. ExpectNoError (err )
122
122
framework.ExpectNoError (f.WaitForPodRunning (pod.Name ))
123
123
```
124
124
@@ -142,7 +142,7 @@ var _ = describe("Thing under test, func() {
142
142
Expect (err2).NotTo (HaveOccurred ())
143
143
}()
144
144
_ , err := cs.CoreV1 ().Services (ns).Create (service)
145
- Expect (err). NotTo ( HaveOccurred () )
145
+ framework. ExpectNoError (err )
146
146
```
147
147
148
148
### Create a Ingress and wait for external components to be created
@@ -168,11 +168,11 @@ Create Kubernetes ingress object:
168
168
Expect (err2).NotTo (HaveOccurred ())
169
169
}()
170
170
ingressCreate , err := cs.NetworkingV1beta1 ().Ingresses (ns).Create (ing)
171
- Expect (err). NotTo ( HaveOccurred () )
171
+ framework. ExpectNoError (err )
172
172
addr , err := jig.WaitForIngressAddress (cs, ns, ingressCreate.Name , 3 *time.Minute )
173
- Expect (err). NotTo ( HaveOccurred () )
173
+ framework. ExpectNoError (err )
174
174
ingress , err := cs.NetworkingV1beta1 ().Ingresses (ns).Get (ing.Name , metav1.GetOptions {ResourceVersion: " 0" })
175
- Expect (err). NotTo ( HaveOccurred () )
175
+ framework. ExpectNoError (err )
176
176
By (fmt.Sprintf (" ALB endpoint from ingress status: %s " , ingress.Status .LoadBalancer .Ingress [0 ].Hostname ))
177
177
```
178
178
@@ -182,15 +182,15 @@ Follow up code, that waits for creations to be happen:
182
182
// skipper http -> https redirect
183
183
By (" Waiting for skipper route to default redirect from http to https, to see that our ingress-controller and skipper works" )
184
184
err = waitForResponse (addr, " http" , 2 *time.Minute , 301 , true )
185
- Expect (err). NotTo ( HaveOccurred () )
185
+ framework. ExpectNoError (err )
186
186
// ALB ready
187
187
By (" Waiting for ALB to create endpoint " + addr + " and skipper route, to see that our ingress-controller and skipper works" )
188
188
err = waitForResponse (addr, " https" , 2 *time.Minute , 200 , true ) // insecure=true
189
- Expect (err). NotTo ( HaveOccurred () )
189
+ framework. ExpectNoError (err )
190
190
// DNS ready
191
191
By (" Waiting for DNS to see that mate and skipper route to service and pod works" )
192
192
err = waitForResponse (hostName, " https" , 2 *time.Minute , 200 , false )
193
- Expect (err). NotTo ( HaveOccurred () )
193
+ framework. ExpectNoError (err )
194
194
```
195
195
196
196
### FAQ
0 commit comments