integration-tests/src/test/java/oracle/kubernetes/operator/utils/DbUtils.java
public static OracleDB createOracleDB(String dbPropsFile) throws Exception {
    OracleDB oracledb = new OracleDB(dbPropsFile);

    // check the db is ready
    String dbnamespace = oracledb.getNamespace();
    String cmd = "kubectl get pod -n " + dbnamespace + " -o jsonpath=\"{.items[0].metadata.name}\"";
    logger.info("running command " + cmd);
    ExecResult result = TestUtils.execOrAbortProcess(cmd, true);
    String podName = result.stdout();

    logger.info("DEBUG: db namespace=" + dbnamespace);
    logger.info("DEBUG: podname=" + podName);
    TestUtils.checkPodReady("", dbnamespace);

    // check the db is ready to use
    cmd = "kubectl logs " + podName + " -n " + dbnamespace;
    TestUtils.checkCmdInLoop(cmd, "The database is ready for use", podName);

    return oracledb;
  }
/**
   * Create Oracle db pod in the k8s cluster.
   *
   * @param dbPropsFile - db properties file
   * @return OracleDB instance
   * @throws Exception if any error occurs when creating Oracle DB pod
   */
Create Oracle db pod in the k8s cluster.
@param dbPropsFile - db properties file
@return OracleDB instance
@throws Exception if any error occurs when creating Oracle DB pod
Create Oracle db pod in the k8s cluster . @param dbPropsFile - db properties file @return OracleDB instance @throws Exception if any error occurs when creating Oracle DB pod
public static OracleDB createOracleDB(String dbPropsFile) throws Exception {
    OracleDB oracledb = new OracleDB(dbPropsFile);
    String dbnamespace = oracledb.getNamespace();
    String cmd = "kubectl get pod -n " + dbnamespace + " -o jsonpath=\"{.items[0].metadata.name}\"";
    logger.info("running command " + cmd);
    ExecResult result = TestUtils.execOrAbortProcess(cmd, true);
    String podName = result.stdout();
    logger.info("DEBUG: db namespace=" + dbnamespace);
    logger.info("DEBUG: podname=" + podName);
    TestUtils.checkPodReady("", dbnamespace);
     to use
    cmd = "kubectl logs " + podName + " -n " + dbnamespace;
    TestUtils.checkCmdInLoop(cmd, "The database is ready for use", podName);
    return oracledb;
  }
public static OracleDB createOracleDB ( String dbPropsFile ) throws Exception { OracleDB oracledb = new OracleDB ( dbPropsFile ) ; String dbnamespace = oracledb . getNamespace ( ) ; String cmd = "kubectl get pod -n " + dbnamespace + " -o jsonpath=\"{.items[0].metadata.name}\"" ; logger . info ( "running command " + cmd ) ; ExecResult result = TestUtils . execOrAbortProcess ( cmd , true ) ; String podName = result . stdout ( ) ; logger . info ( "DEBUG: db namespace=" + dbnamespace ) ; logger . info ( "DEBUG: podname=" + podName ) ; TestUtils . checkPodReady ( "" , dbnamespace ) ; cmd = "kubectl logs " + podName + " -n " + dbnamespace ; TestUtils . checkCmdInLoop ( cmd , "The database is ready for use" , podName ) ; return oracledb ; }
Create Oracle db pod in the k8s cluster.
Create Oracle db pod in the k8s cluster .
// check the db is ready // check the db is ready to use