new-integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/DbUtils.java
public static V1Pod createRcuPod(String fmwBaseImageName, String dbUrl, String dbNamespace, boolean isUseSecret)
      throws ApiException {
    LoggingFacade logger = getLogger();
    ConditionFactory withStandardRetryPolicy = with().pollDelay(10, SECONDS)
        .and().with().pollInterval(2, SECONDS)
        .atMost(10, MINUTES).await();

    Map labels = new HashMap<String, String>();
    labels.put("ruc", "rcu");

    V1Pod podBody = new V1Pod()
        .apiVersion("v1")
        .kind("Pod")
        .metadata(new V1ObjectMeta()
            .name(RCUPODNAME)
            .namespace(dbNamespace)
            .labels(labels))
        .spec(new V1PodSpec()
            .containers(Arrays.asList(
                new V1Container()
                    .name("rcu")
                    .image(fmwBaseImageName)
                    .imagePullPolicy("IfNotPresent")
                    .addArgsItem("sleep")
                    .addArgsItem("infinity")))
            .imagePullSecrets(isUseSecret ? Arrays.asList(
                        new V1LocalObjectReference()
                            .name(OCR_SECRET_NAME))
                        : null));

    V1Pod pvPod = Kubernetes.createPod(dbNamespace, podBody);

    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for {0} to be ready in namespace {1}, "
                + "(elapsed time {2} , remaining time {3}",
                RCUPODNAME,
                dbNamespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(podReady(RCUPODNAME, null, dbNamespace));

    return pvPod;
  }
/**
   * Create a RCU where createRepository script runs.
   *
   * @param fmwBaseImageName the FMW image name
   * @param dbUrl URL of DB
   * @param dbNamespace namespace of DB where RCU is
   * @throws ApiException when create RCU pod fails
   */
Create a RCU where createRepository script runs.
@param fmwBaseImageName the FMW image name
@param dbUrl URL of DB
@param dbNamespace namespace of DB where RCU is
@throws ApiException when create RCU pod fails
Create a RCU where createRepository script runs . @param fmwBaseImageName the FMW image name @param dbUrl URL of DB @param dbNamespace namespace of DB where RCU is @throws ApiException when create RCU pod fails
public static V1Pod createRcuPod(String fmwBaseImageName, String dbUrl, String dbNamespace, boolean isUseSecret)
      throws ApiException {
    LoggingFacade logger = getLogger();
    ConditionFactory withStandardRetryPolicy = with().pollDelay(10, SECONDS)
        .and().with().pollInterval(2, SECONDS)
        .atMost(10, MINUTES).await();
    Map labels = new HashMap<String, String>();
    labels.put("ruc", "rcu");
    V1Pod podBody = new V1Pod()
        .apiVersion("v1")
        .kind("Pod")
        .metadata(new V1ObjectMeta()
            .name(RCUPODNAME)
            .namespace(dbNamespace)
            .labels(labels))
        .spec(new V1PodSpec()
            .containers(Arrays.asList(
                new V1Container()
                    .name("rcu")
                    .image(fmwBaseImageName)
                    .imagePullPolicy("IfNotPresent")
                    .addArgsItem("sleep")
                    .addArgsItem("infinity")))
            .imagePullSecrets(isUseSecret ? Arrays.asList(
                        new V1LocalObjectReference()
                            .name(OCR_SECRET_NAME))
                        : null));
    V1Pod pvPod = Kubernetes.createPod(dbNamespace, podBody);
    withStandardRetryPolicy
        .conditionEvaluationListener(
            condition -> logger.info("Waiting for {0} to be ready in namespace {1}, "
                + "(elapsed time {2} , remaining time {3}",
                RCUPODNAME,
                dbNamespace,
                condition.getElapsedTimeInMS(),
                condition.getRemainingTimeInMS()))
        .until(podReady(RCUPODNAME, null, dbNamespace));
    return pvPod;
  }
public static V1Pod createRcuPod ( String fmwBaseImageName , String dbUrl , String dbNamespace , boolean isUseSecret ) throws ApiException { LoggingFacade logger = getLogger ( ) ; ConditionFactory withStandardRetryPolicy = with ( ) . pollDelay ( 10 , SECONDS ) . and ( ) . with ( ) . pollInterval ( 2 , SECONDS ) . atMost ( 10 , MINUTES ) . await ( ) ; Map labels = new HashMap < String , String > ( ) ; labels . put ( "ruc" , "rcu" ) ; V1Pod podBody = new V1Pod ( ) . apiVersion ( "v1" ) . kind ( "Pod" ) . metadata ( new V1ObjectMeta ( ) . name ( RCUPODNAME ) . namespace ( dbNamespace ) . labels ( labels ) ) . spec ( new V1PodSpec ( ) . containers ( Arrays . asList ( new V1Container ( ) . name ( "rcu" ) . image ( fmwBaseImageName ) . imagePullPolicy ( "IfNotPresent" ) . addArgsItem ( "sleep" ) . addArgsItem ( "infinity" ) ) ) . imagePullSecrets ( isUseSecret ? Arrays . asList ( new V1LocalObjectReference ( ) . name ( OCR_SECRET_NAME ) ) : null ) ) ; V1Pod pvPod = Kubernetes . createPod ( dbNamespace , podBody ) ; withStandardRetryPolicy . conditionEvaluationListener ( condition -> logger . info ( "Waiting for {0} to be ready in namespace {1}, " + "(elapsed time {2} , remaining time {3}" , RCUPODNAME , dbNamespace , condition . getElapsedTimeInMS ( ) , condition . getRemainingTimeInMS ( ) ) ) . until ( podReady ( RCUPODNAME , null , dbNamespace ) ) ; return pvPod ; }
Create a RCU where createRepository script runs.
Create a RCU where createRepository script runs .