@@ -67,7 +67,7 @@ func testHostIP(podClient *framework.PodClient, pod *v1.Pod) {
67
67
t := time .Now ()
68
68
for {
69
69
p , err := podClient .Get (pod .Name , metav1.GetOptions {})
70
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "Failed to get pod %q" , pod .Name )
70
+ framework . ExpectNoError (err , "Failed to get pod %q" , pod .Name )
71
71
if p .Status .HostIP != "" {
72
72
e2elog .Logf ("Pod %s has hostIP: %s" , p .Name , p .Status .HostIP )
73
73
break
@@ -218,7 +218,7 @@ var _ = framework.KubeDescribe("Pods", func() {
218
218
selector := labels .SelectorFromSet (labels .Set (map [string ]string {"time" : value }))
219
219
options := metav1.ListOptions {LabelSelector : selector .String ()}
220
220
pods , err := podClient .List (options )
221
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "failed to query for pods" )
221
+ framework . ExpectNoError (err , "failed to query for pods" )
222
222
gomega .Expect (len (pods .Items )).To (gomega .Equal (0 ))
223
223
options = metav1.ListOptions {
224
224
LabelSelector : selector .String (),
@@ -256,7 +256,7 @@ var _ = framework.KubeDescribe("Pods", func() {
256
256
selector = labels .SelectorFromSet (labels .Set (map [string ]string {"time" : value }))
257
257
options = metav1.ListOptions {LabelSelector : selector .String ()}
258
258
pods , err = podClient .List (options )
259
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "failed to query for pods" )
259
+ framework . ExpectNoError (err , "failed to query for pods" )
260
260
gomega .Expect (len (pods .Items )).To (gomega .Equal (1 ))
261
261
262
262
ginkgo .By ("verifying pod creation was observed" )
@@ -279,11 +279,11 @@ var _ = framework.KubeDescribe("Pods", func() {
279
279
framework .ExpectNoError (f .WaitForPodRunning (pod .Name ))
280
280
// save the running pod
281
281
pod , err = podClient .Get (pod .Name , metav1.GetOptions {})
282
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "failed to GET scheduled pod" )
282
+ framework . ExpectNoError (err , "failed to GET scheduled pod" )
283
283
284
284
ginkgo .By ("deleting the pod gracefully" )
285
285
err = podClient .Delete (pod .Name , metav1 .NewDeleteOptions (30 ))
286
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "failed to delete pod" )
286
+ framework . ExpectNoError (err , "failed to delete pod" )
287
287
288
288
ginkgo .By ("verifying the kubelet observed the termination notice" )
289
289
gomega .Expect (wait .Poll (time .Second * 5 , time .Second * 30 , func () (bool , error ) {
@@ -335,7 +335,7 @@ var _ = framework.KubeDescribe("Pods", func() {
335
335
selector = labels .SelectorFromSet (labels .Set (map [string ]string {"time" : value }))
336
336
options = metav1.ListOptions {LabelSelector : selector .String ()}
337
337
pods , err = podClient .List (options )
338
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "failed to query for pods" )
338
+ framework . ExpectNoError (err , "failed to query for pods" )
339
339
gomega .Expect (len (pods .Items )).To (gomega .Equal (0 ))
340
340
})
341
341
@@ -373,7 +373,7 @@ var _ = framework.KubeDescribe("Pods", func() {
373
373
selector := labels .SelectorFromSet (labels .Set (map [string ]string {"time" : value }))
374
374
options := metav1.ListOptions {LabelSelector : selector .String ()}
375
375
pods , err := podClient .List (options )
376
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "failed to query for pods" )
376
+ framework . ExpectNoError (err , "failed to query for pods" )
377
377
gomega .Expect (len (pods .Items )).To (gomega .Equal (1 ))
378
378
379
379
ginkgo .By ("updating the pod" )
@@ -388,7 +388,7 @@ var _ = framework.KubeDescribe("Pods", func() {
388
388
selector = labels .SelectorFromSet (labels .Set (map [string ]string {"time" : value }))
389
389
options = metav1.ListOptions {LabelSelector : selector .String ()}
390
390
pods , err = podClient .List (options )
391
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "failed to query for pods" )
391
+ framework . ExpectNoError (err , "failed to query for pods" )
392
392
gomega .Expect (len (pods .Items )).To (gomega .Equal (1 ))
393
393
e2elog .Logf ("Pod update OK" )
394
394
})
@@ -427,7 +427,7 @@ var _ = framework.KubeDescribe("Pods", func() {
427
427
selector := labels .SelectorFromSet (labels .Set (map [string ]string {"time" : value }))
428
428
options := metav1.ListOptions {LabelSelector : selector .String ()}
429
429
pods , err := podClient .List (options )
430
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "failed to query for pods" )
430
+ framework . ExpectNoError (err , "failed to query for pods" )
431
431
gomega .Expect (len (pods .Items )).To (gomega .Equal (1 ))
432
432
433
433
ginkgo .By ("updating the pod" )
@@ -491,7 +491,7 @@ var _ = framework.KubeDescribe("Pods", func() {
491
491
},
492
492
}
493
493
_ , err := f .ClientSet .CoreV1 ().Services (f .Namespace .Name ).Create (svc )
494
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "failed to create service" )
494
+ framework . ExpectNoError (err , "failed to create service" )
495
495
496
496
// Make a client pod that verifies that it has the service environment variables.
497
497
podName := "client-envvars-" + string (uuid .NewUUID ())
@@ -538,7 +538,7 @@ var _ = framework.KubeDescribe("Pods", func() {
538
538
*/
539
539
framework .ConformanceIt ("should support remote command execution over websockets [NodeConformance]" , func () {
540
540
config , err := framework .LoadConfig ()
541
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "unable to get base config" )
541
+ framework . ExpectNoError (err , "unable to get base config" )
542
542
543
543
ginkgo .By ("creating the pod" )
544
544
name := "pod-exec-websocket-" + string (uuid .NewUUID ())
@@ -620,7 +620,7 @@ var _ = framework.KubeDescribe("Pods", func() {
620
620
*/
621
621
framework .ConformanceIt ("should support retrieving logs from the container over websockets [NodeConformance]" , func () {
622
622
config , err := framework .LoadConfig ()
623
- gomega . Expect (err ). NotTo ( gomega . HaveOccurred () , "unable to get base config" )
623
+ framework . ExpectNoError (err , "unable to get base config" )
624
624
625
625
ginkgo .By ("creating the pod" )
626
626
name := "pod-logs-websocket-" + string (uuid .NewUUID ())
@@ -798,14 +798,15 @@ var _ = framework.KubeDescribe("Pods", func() {
798
798
}
799
799
800
800
validatePodReadiness := func (expectReady bool ) {
801
- gomega . Expect ( wait .Poll (time .Second , maxReadyStatusUpdateTolerance , func () (bool , error ) {
801
+ err := wait .Poll (time .Second , maxReadyStatusUpdateTolerance , func () (bool , error ) {
802
802
podReady := podClient .PodIsReady (podName )
803
803
res := expectReady == podReady
804
804
if ! res {
805
805
e2elog .Logf ("Expect the Ready condition of pod %q to be %v, but got %v" , podName , expectReady , podReady )
806
806
}
807
807
return res , nil
808
- })).NotTo (gomega .HaveOccurred ())
808
+ })
809
+ framework .ExpectNoError (err )
809
810
}
810
811
811
812
ginkgo .By ("submitting the pod to kubernetes" )
0 commit comments