integration-tests/src/test/java/oracle/kubernetes/operator/utils/Operator.java
public void create() throws Exception {
    LoggerHelper.getLocal().log(Level.INFO, "Starting Operator");
    callHelmInstall();

    LoggerHelper.getLocal().log(Level.INFO, "Checking Operator deployment");

    String availableReplicaCmd =
        "kubectl get deploy weblogic-operator -n "
            + operatorNS
            + " -o jsonpath='{.status.availableReplicas}'";
    for (int i = 0; i < maxIterationsOp; i++) {
      ExecResult replicaResult = ExecCommand.exec(availableReplicaCmd);
      if (replicaResult.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: command "
                + availableReplicaCmd
                + " failed, returned "
                + replicaResult.stderr());
      }
      String availableReplica = replicaResult.stdout().trim();
      if (!availableReplica.equals("1")) {
        if (i == maxIterationsOp - 1) {
          throw new RuntimeException(
              "FAILURE: The WebLogic operator deployment is not available, after waiting 300 seconds");
        }
        LoggerHelper.getLocal().log(Level.INFO,
            "status is " + availableReplica + ", iteration " + i + " of " + maxIterationsOp);
        Thread.sleep(waitTimeOp * 1000);

      } else {
        break;
      }
    }

    verifyPodCreated();
    verifyOperatorReady();
    verifyExternalRestService();
  }
/**
   * Start operator and makes sure it is deployed and ready.
   *
   * @throws Exception exception
   */
Start operator and makes sure it is deployed and ready.
@throws Exception exception
Start operator and makes sure it is deployed and ready . @throws Exception exception
public void create() throws Exception {
    LoggerHelper.getLocal().log(Level.INFO, "Starting Operator");
    callHelmInstall();
    LoggerHelper.getLocal().log(Level.INFO, "Checking Operator deployment");
    String availableReplicaCmd =
        "kubectl get deploy weblogic-operator -n "
            + operatorNS
            + " -o jsonpath='{.status.availableReplicas}'";
    for (int i = 0; i < maxIterationsOp; i++) {
      ExecResult replicaResult = ExecCommand.exec(availableReplicaCmd);
      if (replicaResult.exitValue() != 0) {
        throw new RuntimeException(
            "FAILURE: command "
                + availableReplicaCmd
                + " failed, returned "
                + replicaResult.stderr());
      }
      String availableReplica = replicaResult.stdout().trim();
      if (!availableReplica.equals("1")) {
        if (i == maxIterationsOp - 1) {
          throw new RuntimeException(
              "FAILURE: The WebLogic operator deployment is not available, after waiting 300 seconds");
        }
        LoggerHelper.getLocal().log(Level.INFO,
            "status is " + availableReplica + ", iteration " + i + " of " + maxIterationsOp);
        Thread.sleep(waitTimeOp * 1000);
      } else {
        break;
      }
    }
    verifyPodCreated();
    verifyOperatorReady();
    verifyExternalRestService();
  }
public void create ( ) throws Exception { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Starting Operator" ) ; callHelmInstall ( ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Checking Operator deployment" ) ; String availableReplicaCmd = "kubectl get deploy weblogic-operator -n " + operatorNS + " -o jsonpath='{.status.availableReplicas}'" ; for ( int i = 0 ; i < maxIterationsOp ; i ++ ) { ExecResult replicaResult = ExecCommand . exec ( availableReplicaCmd ) ; if ( replicaResult . exitValue ( ) != 0 ) { throw new RuntimeException ( "FAILURE: command " + availableReplicaCmd + " failed, returned " + replicaResult . stderr ( ) ) ; } String availableReplica = replicaResult . stdout ( ) . trim ( ) ; if ( ! availableReplica . equals ( "1" ) ) { if ( i == maxIterationsOp - 1 ) { throw new RuntimeException ( "FAILURE: The WebLogic operator deployment is not available, after waiting 300 seconds" ) ; } LoggerHelper . getLocal ( ) . log ( Level . INFO , "status is " + availableReplica + ", iteration " + i + " of " + maxIterationsOp ) ; Thread . sleep ( waitTimeOp * 1000 ) ; } else { break ; } } verifyPodCreated ( ) ; verifyOperatorReady ( ) ; verifyExternalRestService ( ) ; }
Start operator and makes sure it is deployed and ready.
Start operator and makes sure it is deployed and ready .