diff --git a/integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/primitive/Command.java b/integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/primitive/Command.java index 3e84a3e4b87..e24b87c1481 100644 --- a/integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/primitive/Command.java +++ b/integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/primitive/Command.java @@ -60,13 +60,13 @@ public boolean execute() { } // check exitValue to determine if the command execution has failed. - if (params.verbose()) { - if (result.exitValue() != 0) { - getLogger().severe("The command execution failed because it returned non-zero exit value: {0}.", result); - } else { + if (result.exitValue() != 0) { + getLogger().severe("The command execution failed because it returned non-zero exit value: {0}.", result); + } else { + if (params.verbose()) { getLogger().info("The command execution succeeded with result: {0}.", result); } - } + } return result.exitValue() == 0; } catch (IOException | InterruptedException ie) { diff --git a/kubernetes/samples/scripts/common/wdt-and-wit-utility.sh b/kubernetes/samples/scripts/common/wdt-and-wit-utility.sh index aa9cc691cee..4ecf53f68d4 100755 --- a/kubernetes/samples/scripts/common/wdt-and-wit-utility.sh +++ b/kubernetes/samples/scripts/common/wdt-and-wit-utility.sh @@ -209,10 +209,12 @@ function run_wdt { cd $WDT_DIR || return 1 + mkdir ${action} + cmd=" $wdt_bin_dir/extractDomainResource.sh -oracle_home $oracle_home - -domain_resource_file domain${action}.yaml + -output_dir ./${action} -domain_home $domain_home_dir -model_file $model_final -variable_file $inputs_final diff --git a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/create-domain.sh b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/create-domain.sh index 06a8edaeea4..13b6aea15b3 100755 --- a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/create-domain.sh +++ b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/create-domain.sh @@ -217,7 +217,7 @@ function createDomainHome { # When using WDT to create a domain, a job to create a domain is started. It then creates # a pod which will run a script that creates a domain. The script then will extract the domain # resource using WDT's extractDomainResource tool. So, the following code loops until the - # domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file. + # domain resource is created by exec'ing into the pod to look for the presence of wko-domain.yaml file. if [ "$useWdt" = true ]; then POD_NAME=`kubectl get pods -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } '` @@ -227,18 +227,18 @@ function createDomainHome { sleep 30 max=30 count=0 - kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" - kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml" + kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" + kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml" while [ $? -eq 1 -a $count -lt $max ]; do sleep 5 - kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" + kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" count=`expr $count + 1` - kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml" + kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml" done - kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/domaincreate.yaml ${domainOutputDir}/domain.yaml + kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/create/wko-domain.yaml ${domainOutputDir}/domain.yaml - # The pod waits for this script to copy the domain resource yaml (domainCreate.yaml) out of the pod and into - # the output directory as domain.yaml. To let the pod know that domainCreate.yaml has been copied, a file called + # The pod waits for this script to copy the domain resource yaml (wko-domain.yaml) out of the pod and into + # the output directory as domain.yaml. To let the pod know that wko-domain.yaml has been copied, a file called # doneExtract is copied into the pod. When the script running in the pod sees the doneExtract file, it exits. touch doneExtract diff --git a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/wdt_k8s_model_template.yaml b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/wdt_k8s_model_template.yaml index acc9d942093..104bca39759 100644 --- a/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/wdt_k8s_model_template.yaml +++ b/kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/wdt_k8s_model_template.yaml @@ -30,8 +30,7 @@ kubernetes: # Identify which Secret contains the credentials for pulling an image %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets: - %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%": - + %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%" # Identify which Secret contains the WebLogic Admin credentials (note that there is an example of # how to create that Secret at the end of this file) webLogicCredentialsSecret: @@ -63,19 +62,19 @@ kubernetes: serverPod: # an (optional) list of environment variable to be set on the servers env: - JAVA_OPTIONS: + - name: JAVA_OPTIONS value: "%JAVA_OPTIONS%" - USER_MEM_ARGS: + - name: USER_MEM_ARGS value: "-Djava.security.egd=file:/dev/./urandom " %OPTIONAL_SERVERPOD_RESOURCES% %LOG_HOME_ON_PV_PREFIX%volumes: - %LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume': - %LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim: + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim: %LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%' %LOG_HOME_ON_PV_PREFIX%volumeMounts: - %LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume': - %LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR% - + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR% + # adminServer is used to configure the desired behavior for starting the administration server. adminServer: # serverStartState legal values are "RUNNING" or "ADMIN" diff --git a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh index 8a684da750f..330b8784be9 100755 --- a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh +++ b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh @@ -209,7 +209,7 @@ function createDomainHome { # When using WDT to create a domain, a job to create a domain is started. It then creates # a pod which will run a script that creates a domain. The script then will extract the domain # resource using WDT's extractDomainResource tool. So, the following code loops until the - # domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file. + # domain resource is created by exec'ing into the pod to look for the presence of wko-domain.yaml file. if [ "$useWdt" = true ]; then POD_NAME=$(getPodName "${JOB_NAME}" "${namespace}") @@ -219,16 +219,16 @@ function createDomainHome { sleep 30 max=30 count=0 - kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml" + kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml" while [ $? -eq 1 -a $count -lt $max ]; do sleep 5 count=`expr $count + 1` - kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml" + kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml" done - kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/domaincreate.yaml ${domainOutputDir}/domain.yaml + kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/create/wko-domain.yaml ${domainOutputDir}/domain.yaml - # The pod waits for this script to copy the domain resource yaml (domainCreate.yaml) out of the pod and into - # the output directory as domain.yaml. To let the pod know that domainCreate.yaml has been copied, a file called + # The pod waits for this script to copy the domain resource yaml (wko-domain.yaml) out of the pod and into + # the output directory as domain.yaml. To let the pod know that wko-domain.yaml has been copied, a file called # doneExtract is copied into the pod. When the script running in the pod sees the doneExtract file, it exits. touch doneExtract diff --git a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh index 4ef9adbdf9a..21188540936 100755 --- a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh +++ b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh @@ -215,13 +215,13 @@ function updateDomainHome { sleep 30 max=30 count=0 - kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domainupdate.yaml" + kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/update" | grep "wko-domain.yaml" while [ $? -eq 1 -a $count -lt $max ]; do sleep 5 count=`expr $count + 1` - kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domainupdate.yaml" + kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/update" | grep "wko-domain.yaml" done - kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/domainupdate.yaml ${domainOutputDir}/domain.yaml + kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/update/wko-domain.yaml ${domainOutputDir}/domain.yaml # The pod waits for this script to copy the domain resource yaml (domainCreate.yaml) out of the pod and into # the output directory as domain.yaml. To let the pod know that domainCreate.yaml has been copied, a file called diff --git a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template.yaml b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template.yaml index 0fe721c6674..b71c5e9841c 100644 --- a/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template.yaml +++ b/kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template.yaml @@ -30,8 +30,7 @@ kubernetes: # Identify which Secret contains the credentials for pulling an image %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets: - %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%": - + %WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%" # Identify which Secret contains the WebLogic Admin credentials (note that there is an example of # how to create that Secret at the end of this file) webLogicCredentialsSecret: @@ -64,19 +63,19 @@ kubernetes: serverPod: # an (optional) list of environment variable to be set on the servers env: - JAVA_OPTIONS: + - name: JAVA_OPTIONS value: "%JAVA_OPTIONS%" - USER_MEM_ARGS: + - name: USER_MEM_ARGS value: "-Djava.security.egd=file:/dev/./urandom " %OPTIONAL_SERVERPOD_RESOURCES% %LOG_HOME_ON_PV_PREFIX%volumes: - %LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume': - %LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim: + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim: %LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%' %LOG_HOME_ON_PV_PREFIX%volumeMounts: - %LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume': - %LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR% - + %LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume' + %LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR% + # adminServer is used to configure the desired behavior for starting the administration server. adminServer: # serverStartState legal values are "RUNNING" or "ADMIN"