integration-tests/src/test/java/oracle/kubernetes/operator/MiiBaseTest.java
protected void modifyDomainYamlWithRestartVersion(Domain domain) {
    final String domainNS = domain.getDomainNs();
    final String domainUid = domain.getDomainUid();
    final String versionNo = getRestartVersion(domainNS, domainUid);
    ExecResult result = null;

    StringBuffer patchDomainCmd = new StringBuffer("kubectl -n ");
    patchDomainCmd
        .append(domainNS)
        .append(" patch domain ")
        .append(domainUid)
        .append(" --type='json' ")
        .append(" -p='[{\"op\": \"replace\", \"path\": \"/spec/restartVersion\", \"value\": \"'")
        .append(versionNo)
        .append("'\" }]'");

    try {
      // patching the domain
      LoggerHelper.getLocal().log(Level.INFO, "Command to patch domain: " + patchDomainCmd);
      result = TestUtils.execOrAbortProcess(patchDomainCmd.toString());
      LoggerHelper.getLocal().log(Level.INFO, "Domain patch result: " + result.stdout());

      // verify the domain restarted
      domain.verifyAdminServerRestarted();
      domain.verifyManagedServersRestarted();
    } catch (Exception ex) {
      ex.printStackTrace();
      StringBuffer errorMsg = new StringBuffer("FAILURE: command: ");
      errorMsg
          .append(patchDomainCmd)
          .append(" failed, returned ")
          .append(result.stdout())
          .append("\n")
          .append(result.stderr());

      Assertions.fail(errorMsg.toString(), ex.getCause());
    }
  }
/**
   * Modify the domain yaml to change domain-level restart version and verify the domain restarted.
   * @param domain the Domain where to change domain-level restart version
   * @param domainNS the domain namespace name
   */
Modify the domain yaml to change domain-level restart version and verify the domain restarted.
@param domain the Domain where to change domain-level restart version
@param domainNS the domain namespace name
Modify the domain yaml to change domain - level restart version and verify the domain restarted . @param domain the Domain where to change domain - level restart version @param domainNS the domain namespace name
protected void modifyDomainYamlWithRestartVersion(Domain domain) {
    final String domainNS = domain.getDomainNs();
    final String domainUid = domain.getDomainUid();
    final String versionNo = getRestartVersion(domainNS, domainUid);
    ExecResult result = null;
    StringBuffer patchDomainCmd = new StringBuffer("kubectl -n ");
    patchDomainCmd
        .append(domainNS)
        .append(" patch domain ")
        .append(domainUid)
        .append(" --type='json' ")
        .append(" -p='[{\"op\": \"replace\", \"path\": \"/spec/restartVersion\", \"value\": \"'")
        .append(versionNo)
        .append("'\" }]'");
    try {
      LoggerHelper.getLocal().log(Level.INFO, "Command to patch domain: " + patchDomainCmd);
      result = TestUtils.execOrAbortProcess(patchDomainCmd.toString());
      LoggerHelper.getLocal().log(Level.INFO, "Domain patch result: " + result.stdout());
      domain.verifyAdminServerRestarted();
      domain.verifyManagedServersRestarted();
    } catch (Exception ex) {
      ex.printStackTrace();
      StringBuffer errorMsg = new StringBuffer("FAILURE: command: ");
      errorMsg
          .append(patchDomainCmd)
          .append(" failed, returned ")
          .append(result.stdout())
          .append("\n")
          .append(result.stderr());
      Assertions.fail(errorMsg.toString(), ex.getCause());
    }
  }
protected void modifyDomainYamlWithRestartVersion ( Domain domain ) { final String domainNS = domain . getDomainNs ( ) ; final String domainUid = domain . getDomainUid ( ) ; final String versionNo = getRestartVersion ( domainNS , domainUid ) ; ExecResult result = null ; StringBuffer patchDomainCmd = new StringBuffer ( "kubectl -n " ) ; patchDomainCmd . append ( domainNS ) . append ( " patch domain " ) . append ( domainUid ) . append ( " --type='json' " ) . append ( " -p='[{\"op\": \"replace\", \"path\": \"/spec/restartVersion\", \"value\": \"'" ) . append ( versionNo ) . append ( "'\" }]'" ) ; try { LoggerHelper . getLocal ( ) . log ( Level . INFO , "Command to patch domain: " + patchDomainCmd ) ; result = TestUtils . execOrAbortProcess ( patchDomainCmd . toString ( ) ) ; LoggerHelper . getLocal ( ) . log ( Level . INFO , "Domain patch result: " + result . stdout ( ) ) ; domain . verifyAdminServerRestarted ( ) ; domain . verifyManagedServersRestarted ( ) ; } catch ( Exception ex ) { ex . printStackTrace ( ) ; StringBuffer errorMsg = new StringBuffer ( "FAILURE: command: " ) ; errorMsg . append ( patchDomainCmd ) . append ( " failed, returned " ) . append ( result . stdout ( ) ) . append ( "\n" ) . append ( result . stderr ( ) ) ; Assertions . fail ( errorMsg . toString ( ) , ex . getCause ( ) ) ; } }
Modify the domain yaml to change domain-level restart version and verify the domain restarted.
Modify the domain yaml to change domain - level restart version and verify the domain restarted .
// patching the domain // verify the domain restarted