@@ -197,22 +197,27 @@ public void testServerPodsRestartByChangingZImage() throws Exception {
197
197
logTestBegin (testMethodName );
198
198
199
199
try {
200
+ ExecAndPrintLog ("docker images" );
200
201
logger .info (
201
202
"About to verifyDomainServerPodRestart for Domain: "
202
203
+ domain .getDomainUid ()
203
204
+ " Image property: "
204
205
+ getWeblogicImageName ()
205
206
+ ":"
206
207
+ getWeblogicImageTag ()
207
- + " to /weblogick8s/middleware/weblogic:duplicate" );
208
+ + " to "
209
+ + System .getenv ("REPO_REGISTRY" )
210
+ + "/weblogick8s/middleware/weblogic:duplicate" );
208
211
209
212
if (BaseTest .SHARED_CLUSTER ) {
210
213
String newImage =
211
214
System .getenv ("REPO_REGISTRY" ) + "/weblogick8s/middleware/weblogic:duplicate" ;
212
215
216
+ String tag =
217
+ "docker tag " + getWeblogicImageName () + ":" + getWeblogicImageTag () + " " + newImage ;
213
218
// tag image with repo name
214
- TestUtils . exec (
215
- "docker tag " + getWeblogicImageName () + ":" + getWeblogicImageTag () + " " + newImage );
219
+ ExecAndPrintLog ( tag );
220
+ ExecAndPrintLog ( "docker images" );
216
221
217
222
// login and push image to ocir
218
223
TestUtils .loginAndPushImageToOCIR (newImage );
@@ -230,26 +235,15 @@ public void testServerPodsRestartByChangingZImage() throws Exception {
230
235
String command =
231
236
"kubectl create secret docker-registry docker-store "
232
237
+ "--docker-server="
233
- + BaseTest . getWeblogicImageServer ( )
238
+ + System . getenv ( "REPO_REGISTRY" )
234
239
+ " --docker-username="
235
- + System .getenv ("OCR_USERNAME " )
240
+ + System .getenv ("REPO_USERNAME " )
236
241
+ " --docker-password="
237
- + System .getenv ("OCR_PASSWORD " )
242
+ + System .getenv ("REPO_PASSWORD " )
238
243
+ " -n "
239
244
+ domain .getDomainNS ()
240
245
+ " --dry-run -o yaml | kubectl apply -f - " ;
241
-
242
- logger .info ("Executing " + command );
243
- ExecResult result = ExecCommand .exec (command );
244
- logger .info (
245
- "Command "
246
- + command
247
- + " return value "
248
- + result .exitValue ()
249
- + " \n failed with stderr = "
250
- + result .stderr ()
251
- + " \n stdout = "
252
- + result .stdout ());
246
+ ExecAndPrintLog (command );
253
247
254
248
// apply new domain yaml and verify pod restart
255
249
domain .verifyDomainServerPodRestart (
@@ -277,6 +271,19 @@ public void testServerPodsRestartByChangingZImage() throws Exception {
277
271
logger .info ("SUCCESS - " + testMethodName );
278
272
}
279
273
274
+ private void ExecAndPrintLog (String command ) throws Exception {
275
+ ExecResult result = ExecCommand .exec (command );
276
+ logger .info (
277
+ "Command "
278
+ + command
279
+ + "\n return value: "
280
+ + result .exitValue ()
281
+ + "\n stderr = "
282
+ + result .stderr ()
283
+ + "\n stdout = "
284
+ + result .stdout ());
285
+ }
286
+
280
287
/**
281
288
* Modify/Add the containerSecurityContext section at ServerPod Level using kubectl apply -f
282
289
* cont.security.context.domain.yaml. Verify all the pods re-started. The property tested is:
0 commit comments