@@ -79,7 +79,7 @@ func runTests(admissionReviewVersion string) {
79
79
close (stop )
80
80
})
81
81
82
- It ("should scaffold a custom defaulting webhook" , func () {
82
+ It ("should scaffold a custom defaulting webhook" , func (specCtx SpecContext ) {
83
83
By ("creating a controller manager" )
84
84
m , err := manager .New (cfg , manager.Options {})
85
85
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
@@ -124,7 +124,7 @@ func runTests(admissionReviewVersion string) {
124
124
}
125
125
}` )
126
126
127
- ctx , cancel := context .WithCancel (context . Background () )
127
+ ctx , cancel := context .WithCancel (specCtx )
128
128
cancel ()
129
129
err = svr .Start (ctx )
130
130
if err != nil && ! os .IsNotExist (err ) {
@@ -155,7 +155,7 @@ func runTests(admissionReviewVersion string) {
155
155
ExpectWithOffset (1 , w .Code ).To (Equal (http .StatusNotFound ))
156
156
})
157
157
158
- It ("should scaffold a custom defaulting webhook with a custom path" , func () {
158
+ It ("should scaffold a custom defaulting webhook with a custom path" , func (specCtx SpecContext ) {
159
159
By ("creating a controller manager" )
160
160
m , err := manager .New (cfg , manager.Options {})
161
161
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
@@ -202,7 +202,7 @@ func runTests(admissionReviewVersion string) {
202
202
}
203
203
}` )
204
204
205
- ctx , cancel := context .WithCancel (context . Background () )
205
+ ctx , cancel := context .WithCancel (specCtx )
206
206
cancel ()
207
207
err = svr .Start (ctx )
208
208
if err != nil && ! os .IsNotExist (err ) {
@@ -234,7 +234,7 @@ func runTests(admissionReviewVersion string) {
234
234
ExpectWithOffset (1 , w .Code ).To (Equal (http .StatusNotFound ))
235
235
})
236
236
237
- It ("should scaffold a custom defaulting webhook which recovers from panics" , func () {
237
+ It ("should scaffold a custom defaulting webhook which recovers from panics" , func (specCtx SpecContext ) {
238
238
By ("creating a controller manager" )
239
239
m , err := manager .New (cfg , manager.Options {})
240
240
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
@@ -278,7 +278,7 @@ func runTests(admissionReviewVersion string) {
278
278
}
279
279
}` )
280
280
281
- ctx , cancel := context .WithCancel (context . Background () )
281
+ ctx , cancel := context .WithCancel (specCtx )
282
282
cancel ()
283
283
err = svr .Start (ctx )
284
284
if err != nil && ! os .IsNotExist (err ) {
@@ -298,7 +298,7 @@ func runTests(admissionReviewVersion string) {
298
298
ExpectWithOffset (1 , w .Body ).To (ContainSubstring (`"message":"panic: fake panic test [recovered]` ))
299
299
})
300
300
301
- It ("should scaffold a custom validating webhook" , func () {
301
+ It ("should scaffold a custom validating webhook" , func (specCtx SpecContext ) {
302
302
By ("creating a controller manager" )
303
303
m , err := manager .New (cfg , manager.Options {})
304
304
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
@@ -345,7 +345,7 @@ func runTests(admissionReviewVersion string) {
345
345
}
346
346
}` )
347
347
348
- ctx , cancel := context .WithCancel (context . Background () )
348
+ ctx , cancel := context .WithCancel (specCtx )
349
349
cancel ()
350
350
err = svr .Start (ctx )
351
351
if err != nil && ! os .IsNotExist (err ) {
@@ -375,7 +375,7 @@ func runTests(admissionReviewVersion string) {
375
375
EventuallyWithOffset (1 , logBuffer ).Should (gbytes .Say (`"msg":"Validating object","object":{"name":"foo","namespace":"default"},"namespace":"default","name":"foo","resource":{"group":"foo.test.org","version":"v1","resource":"testvalidator"},"user":"","requestID":"07e52e8d-4513-11e9-a716-42010a800270"` ))
376
376
})
377
377
378
- It ("should scaffold a custom validating webhook with a custom path" , func () {
378
+ It ("should scaffold a custom validating webhook with a custom path" , func (specCtx SpecContext ) {
379
379
By ("creating a controller manager" )
380
380
m , err := manager .New (cfg , manager.Options {})
381
381
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
@@ -424,7 +424,7 @@ func runTests(admissionReviewVersion string) {
424
424
}
425
425
}` )
426
426
427
- ctx , cancel := context .WithCancel (context . Background () )
427
+ ctx , cancel := context .WithCancel (specCtx )
428
428
cancel ()
429
429
err = svr .Start (ctx )
430
430
if err != nil && ! os .IsNotExist (err ) {
@@ -455,7 +455,7 @@ func runTests(admissionReviewVersion string) {
455
455
ExpectWithOffset (1 , w .Code ).To (Equal (http .StatusNotFound ))
456
456
})
457
457
458
- It ("should scaffold a custom validating webhook which recovers from panics" , func () {
458
+ It ("should scaffold a custom validating webhook which recovers from panics" , func (specCtx SpecContext ) {
459
459
By ("creating a controller manager" )
460
460
m , err := manager .New (cfg , manager.Options {})
461
461
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
@@ -497,7 +497,7 @@ func runTests(admissionReviewVersion string) {
497
497
}
498
498
}` )
499
499
500
- ctx , cancel := context .WithCancel (context . Background () )
500
+ ctx , cancel := context .WithCancel (specCtx )
501
501
cancel ()
502
502
err = svr .Start (ctx )
503
503
if err != nil && ! os .IsNotExist (err ) {
@@ -519,9 +519,9 @@ func runTests(admissionReviewVersion string) {
519
519
ExpectWithOffset (1 , w .Body ).To (ContainSubstring (`"message":"panic: fake panic test [recovered]` ))
520
520
})
521
521
522
- It ("should scaffold a custom validating webhook to validate deletes" , func () {
522
+ It ("should scaffold a custom validating webhook to validate deletes" , func (specCtx SpecContext ) {
523
523
By ("creating a controller manager" )
524
- ctx , cancel := context .WithCancel (context . Background () )
524
+ ctx , cancel := context .WithCancel (specCtx )
525
525
526
526
m , err := manager .New (cfg , manager.Options {})
527
527
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
@@ -630,7 +630,7 @@ func runTests(admissionReviewVersion string) {
630
630
Expect (err ).To (HaveOccurred ())
631
631
})
632
632
633
- It ("should scaffold a custom defaulting and validating webhook" , func () {
633
+ It ("should scaffold a custom defaulting and validating webhook" , func (specCtx SpecContext ) {
634
634
By ("creating a controller manager" )
635
635
m , err := manager .New (cfg , manager.Options {})
636
636
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
@@ -678,7 +678,7 @@ func runTests(admissionReviewVersion string) {
678
678
}
679
679
}` )
680
680
681
- ctx , cancel := context .WithCancel (context . Background () )
681
+ ctx , cancel := context .WithCancel (specCtx )
682
682
cancel ()
683
683
err = svr .Start (ctx )
684
684
if err != nil && ! os .IsNotExist (err ) {
@@ -713,7 +713,7 @@ func runTests(admissionReviewVersion string) {
713
713
EventuallyWithOffset (1 , logBuffer ).Should (gbytes .Say (`"msg":"Validating object","object":{"name":"foo","namespace":"default"},"namespace":"default","name":"foo","resource":{"group":"foo.test.org","version":"v1","resource":"testdefaultvalidator"},"user":"","requestID":"07e52e8d-4513-11e9-a716-42010a800270"` ))
714
714
})
715
715
716
- It ("should scaffold a custom defaulting and validating webhook with a custom path for each of them" , func () {
716
+ It ("should scaffold a custom defaulting and validating webhook with a custom path for each of them" , func (specCtx SpecContext ) {
717
717
By ("creating a controller manager" )
718
718
m , err := manager .New (cfg , manager.Options {})
719
719
ExpectWithOffset (1 , err ).NotTo (HaveOccurred ())
@@ -765,7 +765,7 @@ func runTests(admissionReviewVersion string) {
765
765
}
766
766
}` )
767
767
768
- ctx , cancel := context .WithCancel (context . Background () )
768
+ ctx , cancel := context .WithCancel (specCtx )
769
769
cancel ()
770
770
err = svr .Start (ctx )
771
771
if err != nil && ! os .IsNotExist (err ) {
0 commit comments