36
36
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_PASSWORD_DEFAULT ;
37
37
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_SERVER_NAME_BASE ;
38
38
import static oracle .weblogic .kubernetes .TestConstants .ADMIN_USERNAME_DEFAULT ;
39
+ import static oracle .weblogic .kubernetes .TestConstants .BUSYBOX_IMAGE ;
40
+ import static oracle .weblogic .kubernetes .TestConstants .BUSYBOX_TAG ;
39
41
import static oracle .weblogic .kubernetes .TestConstants .DOMAIN_API_VERSION ;
40
42
import static oracle .weblogic .kubernetes .TestConstants .MANAGED_SERVER_NAME_BASE ;
41
43
import static oracle .weblogic .kubernetes .TestConstants .MII_BASIC_IMAGE_NAME ;
@@ -189,13 +191,13 @@ void testDomainInitContainer() {
189
191
//check if init container got executed in the server pods
190
192
assertTrue (checkPodLogContainMsg (domain1Uid + "-admin-server" ,domain1Namespace ,
191
193
domain1Uid ,"Hi from Domain" ),
192
- "failed to init busybox container command for admin server" );
194
+ "failed to init init-container container command for admin server" );
193
195
assertTrue (checkPodLogContainMsg (domain1Uid + "-managed-server1" ,domain1Namespace ,
194
196
domain1Uid , "Hi from Domain" ),
195
- "failed to init busybox container command for managed server1" );
197
+ "failed to init init-container container command for managed server1" );
196
198
assertTrue (checkPodLogContainMsg (domain1Uid + "-managed-server2" ,domain1Namespace ,
197
199
domain1Uid ,"Hi from Domain" ),
198
- "failed to init busybox container command for managed server2" );
200
+ "failed to init init-container container command for managed server2" );
199
201
200
202
// get the pod creation time stamps
201
203
LinkedHashMap <String , OffsetDateTime > pods = new LinkedHashMap <>();
@@ -223,7 +225,7 @@ private boolean checkPodLogContainMsg(String podName, String podNamespace, Strin
223
225
logger .info ("Checking that pod {0} exists in namespace {1}" ,
224
226
podName , podNamespace );
225
227
checkPodReady (podName , domainUid , podNamespace );
226
- podLog = getPodLog (podName , podNamespace ,"busybox " );
228
+ podLog = getPodLog (podName , podNamespace ,"init-container " );
227
229
} catch (Exception ex ) {
228
230
logger .info ("Caught unexpected exception while calling getPodLog for pod "
229
231
+ podName
@@ -253,9 +255,9 @@ void testAdminServerInitContainer() {
253
255
"can't start or verify domain in namespace " + domain2Namespace );
254
256
255
257
//check if init container got executed for admin server pod
256
- assertTrue (assertDoesNotThrow (() -> getPodLog (domain2Uid + "-admin-server" , domain2Namespace ,"busybox " )
258
+ assertTrue (assertDoesNotThrow (() -> getPodLog (domain2Uid + "-admin-server" , domain2Namespace ,"init-container " )
257
259
.contains ("Hi from AdminServer" ),
258
- "failed to init busybox container command for admin server" ));
260
+ "failed to init init-container container command for admin server" ));
259
261
}
260
262
261
263
/**
@@ -272,11 +274,11 @@ void testClusterInitContainer() {
272
274
273
275
//check if init container got executed
274
276
assertTrue (assertDoesNotThrow (() -> getPodLog (domain3Uid + "-managed-server1" ,
275
- domain3Namespace ,"busybox " ).contains ("Hi from Cluster" ),
276
- "failed to init busybox container command for cluster's managed-server1" ));
277
+ domain3Namespace ,"init-container " ).contains ("Hi from Cluster" ),
278
+ "failed to init init-container container command for cluster's managed-server1" ));
277
279
assertTrue (assertDoesNotThrow (() -> getPodLog (domain3Uid + "-managed-server2" ,
278
- domain3Namespace ,"busybox " ).contains ("Hi from Cluster" ),
279
- "failed to init busybox container command for cluster's managed-server2" ));
280
+ domain3Namespace ,"init-container " ).contains ("Hi from Cluster" ),
281
+ "failed to init init-container container command for cluster's managed-server2" ));
280
282
}
281
283
282
284
/**
@@ -292,9 +294,9 @@ void testMsInitContainer() {
292
294
"can't start or verify domain in namespace " + domain4Namespace );
293
295
294
296
//check if init container got executed
295
- assertTrue (assertDoesNotThrow (() -> getPodLog (domain4Uid + "-managed-server1" , domain4Namespace ,"busybox " )
297
+ assertTrue (assertDoesNotThrow (() -> getPodLog (domain4Uid + "-managed-server1" , domain4Namespace ,"init-container " )
296
298
.contains ("Hi from managed-server1" ),
297
- "failed to init busybox container command for managed server1" ));
299
+ "failed to init init-container container command for managed server1" ));
298
300
}
299
301
300
302
private boolean createVerifyDomain (String domainNamespace , String domainUid , String parentNodeName ) {
@@ -363,9 +365,9 @@ private void createAndVerifyMiiDomain(String domainNamespace, String domainUid,
363
365
case "spec" :
364
366
domain .getSpec ().getServerPod ().addInitContainersItem (new V1Container ()
365
367
.addCommandItem ("echo" ).addArgsItem ("\" Hi from Domain\" " )
366
- .name ("busybox " )
368
+ .name ("init-container " )
367
369
.imagePullPolicy ("IfNotPresent" )
368
- .image ("busybox" ).addEnvItem (new V1EnvVar ()
370
+ .image (BUSYBOX_IMAGE + ":" + BUSYBOX_TAG ).addEnvItem (new V1EnvVar ()
369
371
.name ("DOMAIN_NAME" )
370
372
.value ("xyz" )));
371
373
setPodAntiAffinity (domain );
@@ -374,9 +376,9 @@ private void createAndVerifyMiiDomain(String domainNamespace, String domainUid,
374
376
domain .getSpec ().getAdminServer ().serverPod (new ServerPod ()
375
377
.addInitContainersItem (new V1Container ()
376
378
.addCommandItem ("echo" ).addArgsItem ("\" Hi from AdminServer\" " )
377
- .name ("busybox " )
379
+ .name ("init-container " )
378
380
.imagePullPolicy ("IfNotPresent" )
379
- .image ("busybox" )));
381
+ .image (BUSYBOX_IMAGE + ":" + BUSYBOX_TAG )));
380
382
setPodAntiAffinity (domain );
381
383
break ;
382
384
case "clusters" :
@@ -390,19 +392,19 @@ private void createAndVerifyMiiDomain(String domainNamespace, String domainUid,
390
392
mycluster .getServerPod ()
391
393
.addInitContainersItem (new V1Container ()
392
394
.addCommandItem ("echo" ).addArgsItem ("\" Hi from Cluster \" " )
393
- .name ("busybox " )
395
+ .name ("init-container " )
394
396
.imagePullPolicy ("IfNotPresent" )
395
- .image ("busybox" ));
397
+ .image (BUSYBOX_IMAGE + ":" + BUSYBOX_TAG ));
396
398
break ;
397
399
case "managedServers" :
398
400
domain .getSpec ().addManagedServersItem (new ManagedServer ()
399
401
.serverName ("managed-server1" )
400
402
.serverPod (new ServerPod ()
401
403
.addInitContainersItem (new V1Container ()
402
404
.addCommandItem ("echo" ).addArgsItem ("\" Hi from managed-server1\" " )
403
- .name ("busybox " )
405
+ .name ("init-container " )
404
406
.imagePullPolicy ("IfNotPresent" )
405
- .image ("busybox" ))));
407
+ .image (BUSYBOX_IMAGE + ":" + BUSYBOX_TAG ))));
406
408
setPodAntiAffinity (domain );
407
409
break ;
408
410
default :
0 commit comments