|
10 | 10 | import java.nio.file.Path;
|
11 | 11 | import java.nio.file.Paths;
|
12 | 12 | import java.util.Map;
|
| 13 | +import java.util.logging.Level; |
13 | 14 | import oracle.kubernetes.operator.utils.Domain;
|
14 | 15 | import oracle.kubernetes.operator.utils.DomainCRD;
|
15 | 16 | import oracle.kubernetes.operator.utils.ExecResult;
|
@@ -326,27 +327,32 @@ public void testAdminServerRestartVersions() throws Exception {
|
326 | 327 | try {
|
327 | 328 | logger.info("Modifying the Domain CRD..");
|
328 | 329 | DomainCRD crd = new DomainCRD();
|
329 |
| - String yaml = |
330 |
| - crd.addRestartVersionToAdminServer( |
331 |
| - TestUtils.exec( |
332 |
| - "kubectl get Domain " |
333 |
| - + domain.getDomainUid() |
334 |
| - + " -n " |
335 |
| - + domain.getDomainNS() |
336 |
| - + " --output json") |
337 |
| - .stdout(), |
338 |
| - "v1.1"); |
| 330 | + logger.log( |
| 331 | + Level.INFO, |
| 332 | + "Running kubectl get Domain {0} -n {1} --output json", |
| 333 | + new Object[] {domain.getDomainUid(), domain.getDomainNS()}); |
| 334 | + String jsonCrd = |
| 335 | + TestUtils.exec( |
| 336 | + "kubectl get Domain " |
| 337 | + + domain.getDomainUid() |
| 338 | + + " -n " |
| 339 | + + domain.getDomainNS() |
| 340 | + + " --output json") |
| 341 | + .stdout(); |
| 342 | + logger.info(jsonCrd); |
| 343 | + String yaml = crd.addRestartVersionToAdminServer(jsonCrd, "v1.1"); |
| 344 | + logger.info(yaml); |
339 | 345 | Path path = Paths.get(restartTmpDir, "restart.admin.yaml");
|
340 |
| - logger.info("Path of the modified domain.yaml :" + path.toString()); |
| 346 | + logger.log(Level.INFO, "Path of the modified domain.yaml :{0}", path.toString()); |
341 | 347 | Charset charset = StandardCharsets.UTF_8;
|
342 | 348 | Files.write(path, yaml.getBytes(charset));
|
343 |
| - logger.info("Running kubectl apply -f " + path.toString()); |
| 349 | + logger.log(Level.INFO, "Running kubectl apply -f {0}", path.toString()); |
344 | 350 | ExecResult exec = TestUtils.exec("kubectl apply -f " + path.toString());
|
345 | 351 | logger.info(exec.stdout());
|
346 | 352 | logger.info("Verifying if the admin server is restarted");
|
347 | 353 | domain.verifyAdminServerRestarted();
|
348 | 354 | } finally {
|
349 |
| - logger.info("Running kubectl apply -f " + originalYaml); |
| 355 | + logger.log(Level.INFO, "Running kubectl apply -f {0}", originalYaml); |
350 | 356 | TestUtils.exec("kubectl apply -f " + originalYaml);
|
351 | 357 | logger.info("Verifying if the admin server is restarted");
|
352 | 358 | domain.verifyAdminServerRestarted();
|
|
0 commit comments