new-integration-tests/src/test/java/oracle/weblogic/kubernetes/utils/CommonMiiTestUtils.java
private static Domain createDomainResource(
      String domainResourceName,
      String domNamespace,
      String imageName,
      String adminSecretName,
      String repoSecretName,
      String encryptionSecretName,
      int replicaCount) {
    // create the domain CR
    return new Domain()
        .apiVersion(DOMAIN_API_VERSION)
        .kind("Domain")
        .metadata(new io.kubernetes.client.openapi.models.V1ObjectMeta()
            .name(domainResourceName)
            .namespace(domNamespace))
        .spec(new oracle.weblogic.domain.DomainSpec()
            .domainUid(domainResourceName)
            .domainHomeSourceType("FromModel")
            .image(imageName)
            .addImagePullSecretsItem(new io.kubernetes.client.openapi.models.V1LocalObjectReference()
                .name(repoSecretName))
            .webLogicCredentialsSecret(new io.kubernetes.client.openapi.models.V1SecretReference()
                .name(adminSecretName)
                .namespace(domNamespace))
            .includeServerOutInPodLog(true)
            .serverStartPolicy("IF_NEEDED")
            .serverPod(new oracle.weblogic.domain.ServerPod()
                .addEnvItem(new io.kubernetes.client.openapi.models.V1EnvVar()
                    .name("JAVA_OPTIONS")
                    .value("-Dweblogic.StdoutDebugEnabled=false"))
                .addEnvItem(new io.kubernetes.client.openapi.models.V1EnvVar()
                    .name("USER_MEM_ARGS")
                    .value("-Djava.security.egd=file:/dev/./urandom ")))
            .adminServer(new oracle.weblogic.domain.AdminServer()
                .serverStartState("RUNNING")
                .adminService(new oracle.weblogic.domain.AdminService()
                    .addChannelsItem(new oracle.weblogic.domain.Channel()
                        .channelName("default")
                        .nodePort(0))))
            .addClustersItem(new oracle.weblogic.domain.Cluster()
                .clusterName("cluster-1")
                .replicas(replicaCount)
                .serverStartState("RUNNING"))
            .configuration(new oracle.weblogic.domain.Configuration()
                .model(new oracle.weblogic.domain.Model()
                    .domainType("WLS")
                    .runtimeEncryptionSecret(encryptionSecretName))
                .introspectorJobActiveDeadlineSeconds(300L)));

  }
/**
   * Create a domain object for a Kubernetes domain custom resource using the basic model-in-image image.
   *
   * @param domainResourceName name of the domain resource
   * @param domNamespace Kubernetes namespace that the domain is hosted
   * @param imageName name of the image including its tag
   * @param adminSecretName name of the new WebLogic admin credentials secret
   * @param repoSecretName name of the secret for pulling the WebLogic image
   * @param encryptionSecretName name of the secret used to encrypt the models
   * @param replicaCount number of managed servers to start
   * @return domain object of the domain resource
   */
Create a domain object for a Kubernetes domain custom resource using the basic model-in-image image.
Create a domain object for a Kubernetes domain custom resource using the basic model - in - image image .
private static Domain createDomainResource(
      String domainResourceName,
      String domNamespace,
      String imageName,
      String adminSecretName,
      String repoSecretName,
      String encryptionSecretName,
      int replicaCount) {
    return new Domain()
        .apiVersion(DOMAIN_API_VERSION)
        .kind("Domain")
        .metadata(new io.kubernetes.client.openapi.models.V1ObjectMeta()
            .name(domainResourceName)
            .namespace(domNamespace))
        .spec(new oracle.weblogic.domain.DomainSpec()
            .domainUid(domainResourceName)
            .domainHomeSourceType("FromModel")
            .image(imageName)
            .addImagePullSecretsItem(new io.kubernetes.client.openapi.models.V1LocalObjectReference()
                .name(repoSecretName))
            .webLogicCredentialsSecret(new io.kubernetes.client.openapi.models.V1SecretReference()
                .name(adminSecretName)
                .namespace(domNamespace))
            .includeServerOutInPodLog(true)
            .serverStartPolicy("IF_NEEDED")
            .serverPod(new oracle.weblogic.domain.ServerPod()
                .addEnvItem(new io.kubernetes.client.openapi.models.V1EnvVar()
                    .name("JAVA_OPTIONS")
                    .value("-Dweblogic.StdoutDebugEnabled=false"))
                .addEnvItem(new io.kubernetes.client.openapi.models.V1EnvVar()
                    .name("USER_MEM_ARGS")
                    .value("-Djava.security.egd=file:/dev/./urandom ")))
            .adminServer(new oracle.weblogic.domain.AdminServer()
                .serverStartState("RUNNING")
                .adminService(new oracle.weblogic.domain.AdminService()
                    .addChannelsItem(new oracle.weblogic.domain.Channel()
                        .channelName("default")
                        .nodePort(0))))
            .addClustersItem(new oracle.weblogic.domain.Cluster()
                .clusterName("cluster-1")
                .replicas(replicaCount)
                .serverStartState("RUNNING"))
            .configuration(new oracle.weblogic.domain.Configuration()
                .model(new oracle.weblogic.domain.Model()
                    .domainType("WLS")
                    .runtimeEncryptionSecret(encryptionSecretName))
                .introspectorJobActiveDeadlineSeconds(300L)));
  }
private static Domain createDomainResource ( String domainResourceName , String domNamespace , String imageName , String adminSecretName , String repoSecretName , String encryptionSecretName , int replicaCount ) { return new Domain ( ) . apiVersion ( DOMAIN_API_VERSION ) . kind ( "Domain" ) . metadata ( new io . kubernetes . client . openapi . models . V1ObjectMeta ( ) . name ( domainResourceName ) . namespace ( domNamespace ) ) . spec ( new oracle . weblogic . domain . DomainSpec ( ) . domainUid ( domainResourceName ) . domainHomeSourceType ( "FromModel" ) . image ( imageName ) . addImagePullSecretsItem ( new io . kubernetes . client . openapi . models . V1LocalObjectReference ( ) . name ( repoSecretName ) ) . webLogicCredentialsSecret ( new io . kubernetes . client . openapi . models . V1SecretReference ( ) . name ( adminSecretName ) . namespace ( domNamespace ) ) . includeServerOutInPodLog ( true ) . serverStartPolicy ( "IF_NEEDED" ) . serverPod ( new oracle . weblogic . domain . ServerPod ( ) . addEnvItem ( new io . kubernetes . client . openapi . models . V1EnvVar ( ) . name ( "JAVA_OPTIONS" ) . value ( "-Dweblogic.StdoutDebugEnabled=false" ) ) . addEnvItem ( new io . kubernetes . client . openapi . models . V1EnvVar ( ) . name ( "USER_MEM_ARGS" ) . value ( "-Djava.security.egd=file:/dev/./urandom " ) ) ) . adminServer ( new oracle . weblogic . domain . AdminServer ( ) . serverStartState ( "RUNNING" ) . adminService ( new oracle . weblogic . domain . AdminService ( ) . addChannelsItem ( new oracle . weblogic . domain . Channel ( ) . channelName ( "default" ) . nodePort ( 0 ) ) ) ) . addClustersItem ( new oracle . weblogic . domain . Cluster ( ) . clusterName ( "cluster-1" ) . replicas ( replicaCount ) . serverStartState ( "RUNNING" ) ) . configuration ( new oracle . weblogic . domain . Configuration ( ) . model ( new oracle . weblogic . domain . Model ( ) . domainType ( "WLS" ) . runtimeEncryptionSecret ( encryptionSecretName ) ) . introspectorJobActiveDeadlineSeconds ( 300L ) ) ) ; }
Create a domain object for a Kubernetes domain custom resource using the basic model-in-image image.
Create a domain object for a Kubernetes domain custom resource using the basic model - in - image image .
// create the domain CR