Skip to content

Commit 961f377

Browse files
authored
Owls100056 backport PR#3205 to release/3.4 (#3219)
* Backport PR#3205
1 parent 34a4a98 commit 961f377

File tree

7 files changed

+41
-41
lines changed

7 files changed

+41
-41
lines changed

integration-tests/src/test/java/oracle/weblogic/kubernetes/actions/impl/primitive/Command.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,13 +60,13 @@ public boolean execute() {
6060
}
6161

6262
// check exitValue to determine if the command execution has failed.
63-
if (params.verbose()) {
64-
if (result.exitValue() != 0) {
65-
getLogger().severe("The command execution failed because it returned non-zero exit value: {0}.", result);
66-
} else {
63+
if (result.exitValue() != 0) {
64+
getLogger().severe("The command execution failed because it returned non-zero exit value: {0}.", result);
65+
} else {
66+
if (params.verbose()) {
6767
getLogger().info("The command execution succeeded with result: {0}.", result);
6868
}
69-
}
69+
}
7070

7171
return result.exitValue() == 0;
7272
} catch (IOException | InterruptedException ie) {

kubernetes/samples/scripts/common/wdt-and-wit-utility.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,10 +209,12 @@ function run_wdt {
209209

210210
cd $WDT_DIR || return 1
211211

212+
mkdir ${action}
213+
212214
cmd="
213215
$wdt_bin_dir/extractDomainResource.sh
214216
-oracle_home $oracle_home
215-
-domain_resource_file domain${action}.yaml
217+
-output_dir ./${action}
216218
-domain_home $domain_home_dir
217219
-model_file $model_final
218220
-variable_file $inputs_final

kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/create-domain.sh

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ function createDomainHome {
217217
# When using WDT to create a domain, a job to create a domain is started. It then creates
218218
# a pod which will run a script that creates a domain. The script then will extract the domain
219219
# resource using WDT's extractDomainResource tool. So, the following code loops until the
220-
# domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file.
220+
# domain resource is created by exec'ing into the pod to look for the presence of wko-domain.yaml file.
221221

222222
if [ "$useWdt" = true ]; then
223223
POD_NAME=`kubectl get pods -n ${namespace} | grep ${JOB_NAME} | awk ' { print $1; } '`
@@ -227,18 +227,18 @@ function createDomainHome {
227227
sleep 30
228228
max=30
229229
count=0
230-
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt"
231-
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
230+
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create"
231+
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml"
232232
while [ $? -eq 1 -a $count -lt $max ]; do
233233
sleep 5
234-
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt"
234+
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create"
235235
count=`expr $count + 1`
236-
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
236+
kubectl exec $POD_NAME -c create-fmw-infra-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml"
237237
done
238-
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/domaincreate.yaml ${domainOutputDir}/domain.yaml
238+
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/create/wko-domain.yaml ${domainOutputDir}/domain.yaml
239239

240-
# The pod waits for this script to copy the domain resource yaml (domainCreate.yaml) out of the pod and into
241-
# the output directory as domain.yaml. To let the pod know that domainCreate.yaml has been copied, a file called
240+
# The pod waits for this script to copy the domain resource yaml (wko-domain.yaml) out of the pod and into
241+
# the output directory as domain.yaml. To let the pod know that wko-domain.yaml has been copied, a file called
242242
# doneExtract is copied into the pod. When the script running in the pod sees the doneExtract file, it exits.
243243

244244
touch doneExtract

kubernetes/samples/scripts/create-fmw-infrastructure-domain/domain-home-on-pv/wdt_k8s_model_template.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ kubernetes:
3030

3131
# Identify which Secret contains the credentials for pulling an image
3232
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets:
33-
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%":
34-
33+
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%"
3534
# Identify which Secret contains the WebLogic Admin credentials (note that there is an example of
3635
# how to create that Secret at the end of this file)
3736
webLogicCredentialsSecret:
@@ -63,19 +62,19 @@ kubernetes:
6362
serverPod:
6463
# an (optional) list of environment variable to be set on the servers
6564
env:
66-
JAVA_OPTIONS:
65+
- name: JAVA_OPTIONS
6766
value: "%JAVA_OPTIONS%"
68-
USER_MEM_ARGS:
67+
- name: USER_MEM_ARGS
6968
value: "-Djava.security.egd=file:/dev/./urandom "
7069
%OPTIONAL_SERVERPOD_RESOURCES%
7170
%LOG_HOME_ON_PV_PREFIX%volumes:
72-
%LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume':
73-
%LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim:
71+
%LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume'
72+
%LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim:
7473
%LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%'
7574
%LOG_HOME_ON_PV_PREFIX%volumeMounts:
76-
%LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume':
77-
%LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR%
78-
75+
%LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume'
76+
%LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR%
77+
7978
# adminServer is used to configure the desired behavior for starting the administration server.
8079
adminServer:
8180
# serverStartState legal values are "RUNNING" or "ADMIN"

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/create-domain.sh

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ function createDomainHome {
209209
# When using WDT to create a domain, a job to create a domain is started. It then creates
210210
# a pod which will run a script that creates a domain. The script then will extract the domain
211211
# resource using WDT's extractDomainResource tool. So, the following code loops until the
212-
# domain resource is created by exec'ing into the pod to look for the presence of domainCreate.yaml file.
212+
# domain resource is created by exec'ing into the pod to look for the presence of wko-domain.yaml file.
213213

214214
if [ "$useWdt" = true ]; then
215215
POD_NAME=$(getPodName "${JOB_NAME}" "${namespace}")
@@ -219,16 +219,16 @@ function createDomainHome {
219219
sleep 30
220220
max=30
221221
count=0
222-
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
222+
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml"
223223
while [ $? -eq 1 -a $count -lt $max ]; do
224224
sleep 5
225225
count=`expr $count + 1`
226-
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domaincreate.yaml"
226+
kubectl exec $POD_NAME -c create-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/create" | grep "wko-domain.yaml"
227227
done
228-
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/domaincreate.yaml ${domainOutputDir}/domain.yaml
228+
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/create/wko-domain.yaml ${domainOutputDir}/domain.yaml
229229

230-
# The pod waits for this script to copy the domain resource yaml (domainCreate.yaml) out of the pod and into
231-
# the output directory as domain.yaml. To let the pod know that domainCreate.yaml has been copied, a file called
230+
# The pod waits for this script to copy the domain resource yaml (wko-domain.yaml) out of the pod and into
231+
# the output directory as domain.yaml. To let the pod know that wko-domain.yaml has been copied, a file called
232232
# doneExtract is copied into the pod. When the script running in the pod sees the doneExtract file, it exits.
233233

234234
touch doneExtract

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/update-domain.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -215,13 +215,13 @@ function updateDomainHome {
215215
sleep 30
216216
max=30
217217
count=0
218-
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domainupdate.yaml"
218+
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/update" | grep "wko-domain.yaml"
219219
while [ $? -eq 1 -a $count -lt $max ]; do
220220
sleep 5
221221
count=`expr $count + 1`
222-
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt" | grep "domainupdate.yaml"
222+
kubectl exec $POD_NAME -c update-weblogic-sample-domain-job -n ${namespace} -- bash -c "ls -l ${domainPVMountPath}/wdt/update" | grep "wko-domain.yaml"
223223
done
224-
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/domainupdate.yaml ${domainOutputDir}/domain.yaml
224+
kubectl cp ${namespace}/$POD_NAME:${domainPVMountPath}/wdt/update/wko-domain.yaml ${domainOutputDir}/domain.yaml
225225

226226
# The pod waits for this script to copy the domain resource yaml (domainCreate.yaml) out of the pod and into
227227
# the output directory as domain.yaml. To let the pod know that domainCreate.yaml has been copied, a file called

kubernetes/samples/scripts/create-weblogic-domain/domain-home-on-pv/wdt_k8s_model_template.yaml

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@ kubernetes:
3030

3131
# Identify which Secret contains the credentials for pulling an image
3232
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX%imagePullSecrets:
33-
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%":
34-
33+
%WEBLOGIC_IMAGE_PULL_SECRET_PREFIX% - name: "%WEBLOGIC_IMAGE_PULL_SECRET_NAME%"
3534
# Identify which Secret contains the WebLogic Admin credentials (note that there is an example of
3635
# how to create that Secret at the end of this file)
3736
webLogicCredentialsSecret:
@@ -64,19 +63,19 @@ kubernetes:
6463
serverPod:
6564
# an (optional) list of environment variable to be set on the servers
6665
env:
67-
JAVA_OPTIONS:
66+
- name: JAVA_OPTIONS
6867
value: "%JAVA_OPTIONS%"
69-
USER_MEM_ARGS:
68+
- name: USER_MEM_ARGS
7069
value: "-Djava.security.egd=file:/dev/./urandom "
7170
%OPTIONAL_SERVERPOD_RESOURCES%
7271
%LOG_HOME_ON_PV_PREFIX%volumes:
73-
%LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume':
74-
%LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim:
72+
%LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume'
73+
%LOG_HOME_ON_PV_PREFIX% persistentVolumeClaim:
7574
%LOG_HOME_ON_PV_PREFIX% claimName: '%DOMAIN_PVC_NAME%'
7675
%LOG_HOME_ON_PV_PREFIX%volumeMounts:
77-
%LOG_HOME_ON_PV_PREFIX% 'weblogic-domain-storage-volume':
78-
%LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR%
79-
76+
%LOG_HOME_ON_PV_PREFIX% - name: 'weblogic-domain-storage-volume'
77+
%LOG_HOME_ON_PV_PREFIX% mountPath: %DOMAIN_ROOT_DIR%
78+
8079
# adminServer is used to configure the desired behavior for starting the administration server.
8180
adminServer:
8281
# serverStartState legal values are "RUNNING" or "ADMIN"

0 commit comments

Comments
 (0)