integration-tests/src/test/java/oracle/kubernetes/operator/MiiBaseTest.java
public void modifyDomainYamlWithNewConfigMapAndDomainRestartVersion(
      String cmName, Domain domain) throws Exception {
    String originalYaml =
        getUserProjectsDir()
            + "/weblogic-domains/"
            + domain.getDomainUid()
            + "/domain.yaml";

    // Modify the original domain yaml to include restartVersion in admin server node
    DomainCrd crd = new DomainCrd(originalYaml);
    Map<String, String> objectNode = new HashMap<>();
    objectNode.put("restartVersion", "v1.1");
    crd.addObjectNodeToDomain(objectNode);
    String modYaml = crd.getYamlTree();
    LoggerHelper.getLocal().log(Level.INFO, modYaml);

    //change config map name to new config map
    modYaml.replaceAll((String)domain.getDomainMap().get("miiConfigMap"), cmName);

    // Write the modified yaml to a new file
    Path path = Paths.get(getUserProjectsDir()
        + "/weblogic-domains/"
        + domain.getDomainUid(), "modified.domain.yaml");
    LoggerHelper.getLocal().log(Level.INFO, "Path of the modified domain.yaml :{0}", path.toString());
    Charset charset = StandardCharsets.UTF_8;
    Files.write(path, modYaml.getBytes(charset));

    // Apply the new yaml to update the domain crd
    LoggerHelper.getLocal().log(Level.INFO, "kubectl apply -f {0}", path.toString());
    ExecResult exec = TestUtils.execOrAbortProcess("kubectl apply -f " + path.toString());
    LoggerHelper.getLocal().log(Level.INFO, exec.stdout());

  }
/**
   * Modify the domain yaml to add reference to config map and change domain-level restart version.
   * @param cmName Config map name
   * @param domain the domain
   * @throws Exception on failure
   */
Modify the domain yaml to add reference to config map and change domain-level restart version.
@param cmName Config map name
@param domain the domain
@throws Exception on failure
Modify the domain yaml to add reference to config map and change domain - level restart version . @param cmName Config map name @param domain the domain @throws Exception on failure
public void modifyDomainYamlWithNewConfigMapAndDomainRestartVersion(
      String cmName, Domain domain) throws Exception {
    String originalYaml =
        getUserProjectsDir()
            + "/weblogic-domains/"
            + domain.getDomainUid()
            + "/domain.yaml";
    DomainCrd crd = new DomainCrd(originalYaml);
    Map<String, String> objectNode = new HashMap<>();
    objectNode.put("restartVersion", "v1.1");
    crd.addObjectNodeToDomain(objectNode);
    String modYaml = crd.getYamlTree();
    LoggerHelper.getLocal().log(Level.INFO, modYaml);
    modYaml.replaceAll((String)domain.getDomainMap().get("miiConfigMap"), cmName);
    Path path = Paths.get(getUserProjectsDir()
        + "/weblogic-domains/"
        + domain.getDomainUid(), "modified.domain.yaml");
    LoggerHelper.getLocal().log(Level.INFO, "Path of the modified domain.yaml :{0}", path.toString());
    Charset charset = StandardCharsets.UTF_8;
    Files.write(path, modYaml.getBytes(charset));
    LoggerHelper.getLocal().log(Level.INFO, "kubectl apply -f {0}", path.toString());
    ExecResult exec = TestUtils.execOrAbortProcess("kubectl apply -f " + path.toString());
    LoggerHelper.getLocal().log(Level.INFO, exec.stdout());
  }
public void modifyDomainYamlWithNewConfigMapAndDomainRestartVersion ( String cmName , Domain domain ) throws Exception { String originalYaml = getUserProjectsDir ( ) + "/weblogic-domains/" + domain . getDomainUid ( ) + "/domain.yaml" ; DomainCrd crd = new DomainCrd ( originalYaml ) ; Map < String , String > objectNode = new HashMap < > ( ) ; objectNode . put ( "restartVersion" , "v1.1" ) ; crd . addObjectNodeToDomain ( objectNode ) ; String modYaml = crd . getYamlTree ( ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , modYaml ) ; modYaml . replaceAll ( ( String ) domain . getDomainMap ( ) . get ( "miiConfigMap" ) , cmName ) ; Path path = Paths . get ( getUserProjectsDir ( ) + "/weblogic-domains/" + domain . getDomainUid ( ) , "modified.domain.yaml" ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Path of the modified domain.yaml :{0}" , path . toString ( ) ) ; Charset charset = StandardCharsets . UTF_8 ; Files . write ( path , modYaml . getBytes ( charset ) ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "kubectl apply -f {0}" , path . toString ( ) ) ; ExecResult exec = TestUtils . execOrAbortProcess ( "kubectl apply -f " + path . toString ( ) ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , exec . stdout ( ) ) ; }
Modify the domain yaml to add reference to config map and change domain-level restart version.
Modify the domain yaml to add reference to config map and change domain - level restart version .
// Modify the original domain yaml to include restartVersion in admin server node //change config map name to new config map // Write the modified yaml to a new file // Apply the new yaml to update the domain crd