@@ -254,6 +254,45 @@ test('init containers cannot have startup probe', () => {
254
254
255
255
} ) ;
256
256
257
+ test ( 'sidecar containers can have liveness probe' , ( ) => {
258
+
259
+ const chart = Testing . chart ( ) ;
260
+ const pod = new kplus . Pod ( chart , 'Pod' , { containers : [ { image : 'image' } ] } ) ;
261
+
262
+ pod . addInitContainer ( { image : 'image' , liveness : Probe . fromTcpSocket ( ) , restartPolicy : ContainerRestartPolicy . ALWAYS } ) ;
263
+
264
+ const spec = Testing . synth ( chart ) [ 0 ] . spec ;
265
+
266
+ expect ( spec . initContainers [ 0 ] . livenessProbe ) . toBeTruthy ( ) ;
267
+
268
+ } ) ;
269
+
270
+ test ( 'sidecar containers can have readiness probe' , ( ) => {
271
+
272
+ const chart = Testing . chart ( ) ;
273
+ const pod = new kplus . Pod ( chart , 'Pod' , { containers : [ { image : 'image' } ] } ) ;
274
+
275
+ pod . addInitContainer ( { image : 'image' , readiness : Probe . fromTcpSocket ( ) , restartPolicy : ContainerRestartPolicy . ALWAYS } ) ;
276
+
277
+ const spec = Testing . synth ( chart ) [ 0 ] . spec ;
278
+
279
+ expect ( spec . initContainers [ 0 ] . readinessProbe ) . toBeTruthy ( ) ;
280
+
281
+ } ) ;
282
+
283
+ test ( 'sidecar containers can have startup probe' , ( ) => {
284
+
285
+ const chart = Testing . chart ( ) ;
286
+ const pod = new kplus . Pod ( chart , 'Pod' , { containers : [ { image : 'image' } ] } ) ;
287
+
288
+ pod . addInitContainer ( { image : 'image' , startup : Probe . fromTcpSocket ( ) , restartPolicy : ContainerRestartPolicy . ALWAYS } ) ;
289
+
290
+ const spec = Testing . synth ( chart ) [ 0 ] . spec ;
291
+
292
+ expect ( spec . initContainers [ 0 ] . startupProbe ) . toBeTruthy ( ) ;
293
+
294
+ } ) ;
295
+
257
296
test ( 'can specify init containers at instantiation' , ( ) => {
258
297
259
298
const chart = Testing . chart ( ) ;
0 commit comments