Skip to content

Commit b7fec9e

Browse files
committed
Checkstyle errors
1 parent daec17e commit b7fec9e

File tree

2 files changed

+35
-34
lines changed

2 files changed

+35
-34
lines changed

integration-tests/src/test/java/oracle/kubernetes/operator/ItOperator.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -529,20 +529,20 @@ private void modifyDomainConfig(Domain domain) throws Exception {
529529
BaseTest.getProjectRoot() + "/integration-tests/src/test/resources/modifyAcceptBacklog.py",
530530
scriptsLocInPod + "/modifyAcceptBacklog.py",
531531
adminPod,
532-
domain.getDomainNS());
532+
domain.getDomainNs());
533533

534534
TestUtils.copyFileViaCat(
535535
BaseTest.getProjectRoot() + "/integration-tests/src/test/resources/callpyscript.sh",
536536
scriptsLocInPod + "/callpyscript.sh",
537537
adminPod,
538-
domain.getDomainNS());
538+
domain.getDomainNs());
539539
String[] args = {
540540
scriptsLocInPod + "/modifyAcceptBacklog.py",
541541
BaseTest.getUsername(),
542542
BaseTest.getPassword(),
543543
"t3://" + adminPod + ":" + domain.getDomainMap().get("t3ChannelPort")
544544
};
545545
TestUtils.callShellScriptByExecToPod(
546-
adminPod, domain.getDomainNS(), scriptsLocInPod, "callpyscript.sh", args);
546+
adminPod, domain.getDomainNs(), scriptsLocInPod, "callpyscript.sh", args);
547547
}
548548
}

integration-tests/src/test/java/oracle/kubernetes/operator/utils/TestUtils.java

Lines changed: 32 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -972,6 +972,38 @@ public static String callShellScriptByExecToPod(
972972
return result.stdout().trim();
973973
}
974974

975+
/**
976+
* exec into the pod and call the shell script with given arguments.
977+
*
978+
* @param podName pod name
979+
* @param domainNS namespace
980+
* @param scriptsLocInPod script location
981+
* @param shScriptName script name
982+
* @param args script arguments
983+
* @throws Exception exception
984+
*/
985+
public static void callShellScriptByExecToPod(
986+
String podName, String domainNS, String scriptsLocInPod, String shScriptName, String[] args)
987+
throws Exception {
988+
StringBuffer cmdKubectlSh = new StringBuffer("kubectl -n ");
989+
cmdKubectlSh
990+
.append(domainNS)
991+
.append(" exec -it ")
992+
.append(podName)
993+
.append(" -- bash -c 'chmod +x -R ")
994+
.append(scriptsLocInPod)
995+
.append(" && ")
996+
.append(scriptsLocInPod)
997+
.append("/")
998+
.append(shScriptName)
999+
.append(" ")
1000+
.append(String.join(" ", args).toString())
1001+
.append("'");
1002+
1003+
logger.info("Command to call kubectl sh file " + cmdKubectlSh);
1004+
TestUtils.exec(cmdKubectlSh.toString());
1005+
}
1006+
9751007
public static void createDirUnderDomainPV(String dirPath) throws Exception {
9761008

9771009
String crdCmd =
@@ -1434,35 +1466,4 @@ public static ExecResult kubectlpatch(String domainUid, String domainNS, String
14341466
+ " --type merge";
14351467
return exec(cmd, true);
14361468
}
1437-
/**
1438-
* exec into the pod and call the shell script with given arguments
1439-
*
1440-
* @param podName
1441-
* @param domainNS
1442-
* @param scriptsLocInPod
1443-
* @param shScriptName
1444-
* @param args
1445-
* @throws Exception
1446-
*/
1447-
public static void callShellScriptByExecToPod(
1448-
String podName, String domainNS, String scriptsLocInPod, String shScriptName, String[] args)
1449-
throws Exception {
1450-
StringBuffer cmdKubectlSh = new StringBuffer("kubectl -n ");
1451-
cmdKubectlSh
1452-
.append(domainNS)
1453-
.append(" exec -it ")
1454-
.append(podName)
1455-
.append(" -- bash -c 'chmod +x -R ")
1456-
.append(scriptsLocInPod)
1457-
.append(" && ")
1458-
.append(scriptsLocInPod)
1459-
.append("/")
1460-
.append(shScriptName)
1461-
.append(" ")
1462-
.append(String.join(" ", args).toString())
1463-
.append("'");
1464-
1465-
logger.info("Command to call kubectl sh file " + cmdKubectlSh);
1466-
TestUtils.exec(cmdKubectlSh.toString());
1467-
}
14681469
}

0 commit comments

Comments
 (0)