Skip to content

Commit abbe440

Browse files
authored
Merge branch 'master' into better-status
2 parents 8fe5cde + 04dad23 commit abbe440

19 files changed

+799
-86
lines changed

kubernetes/create-weblogic-domain-inputs.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ weblogicDomainStorageType: HOST_PATH
4646
# The following line must be uncomment and customized:
4747
#weblogicDomainStoragePath: /scratch/k8s_dir/domain1
4848

49+
# Reclaim policy of the domain's persistent storage
50+
# The valid values are: 'Retain', 'Delete', and 'Recycle'
51+
weblogicDomainStorageReclaimPolicy: Retain
52+
4953
# Total storage allocated to the domain's persistent storage.
5054
weblogicDomainStorageSize: 10Gi
5155

kubernetes/create-weblogic-domain.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
#
1616

1717
script="${BASH_SOURCE[0]}"
18-
scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
18+
scriptDir="$( cd "$(dirname "${script}")" > /dev/null 2>&1 ; pwd -P)"
1919
internalDir="${scriptDir}/internal"
2020

2121
# This is the script that the customers use to create a domain.

kubernetes/create-weblogic-operator.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
44

55
script="${BASH_SOURCE[0]}"
6-
scriptDir="$( cd "$( dirname "${script}" )" && pwd )"
6+
scriptDir="$( cd "$(dirname "${script}")" > /dev/null 2>&1 ; pwd -P)"
77
internalDir="${scriptDir}/internal"
88

99
# This is the script that the customers use to create an operator.

kubernetes/internal/create-weblogic-domain.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,29 @@ function validateClusterName {
124124
clusterNameLC=$(toLower $clusterName)
125125
}
126126

127+
#
128+
# Function to validate the weblogic domain storage reclaim policy
129+
#
130+
function validateWeblogicDomainStorageReclaimPolicy {
131+
validateInputParamsSpecified weblogicDomainStorageReclaimPolicy
132+
if [ ! -z "${weblogicDomainStorageReclaimPolicy}" ]; then
133+
case ${weblogicDomainStorageReclaimPolicy} in
134+
"Retain")
135+
;;
136+
"Delete")
137+
if [ "${weblogicDomainStoragePath:0:5}" != "/tmp/" ]; then
138+
validationError "ERROR - Invalid value for weblogicDomainStorageReclaimPolicy ${weblogicDomainStorageReclaimPolicy} with weblogicDomainStoragePath ${weblogicDomainStoragePath} that is not /tmp/"
139+
fi
140+
;;
141+
"Recycle")
142+
;;
143+
*)
144+
validationError "Invalid value for weblogicDomainStorageReclaimPolicy: ${weblogicDomainStorageReclaimPolicy}. Valid values are Retain, Delete and Recycle."
145+
;;
146+
esac
147+
fi
148+
}
149+
127150
#
128151
# Function to validate the weblogic domain storage type
129152
#
@@ -333,6 +356,7 @@ function initialize {
333356
validateNamespace
334357
validateClusterName
335358
validateWeblogicDomainStorageType
359+
validateWeblogicDomainStorageReclaimPolicy
336360
validateWeblogicCredentialsSecretName
337361
validateWeblogicImagePullSecretName
338362
validateLoadBalancer
@@ -383,6 +407,7 @@ function createYamlFiles {
383407
sed -i -e "s:%DOMAIN_UID%:${domainUID}:g" ${domainPVOutput}
384408
sed -i -e "s:%NAMESPACE%:$namespace:g" ${domainPVOutput}
385409
sed -i -e "s:%WEBLOGIC_DOMAIN_STORAGE_PATH%:${weblogicDomainStoragePath}:g" ${domainPVOutput}
410+
sed -i -e "s:%WEBLOGIC_DOMAIN_STORAGE_RECLAIM_POLICY%:${weblogicDomainStorageReclaimPolicy}:g" ${domainPVOutput}
386411
sed -i -e "s:%WEBLOGIC_DOMAIN_STORAGE_SIZE%:${weblogicDomainStorageSize}:g" ${domainPVOutput}
387412
sed -i -e "s:%HOST_PATH_PREFIX%:${hostPathPrefix}:g" ${domainPVOutput}
388413
sed -i -e "s:%NFS_PREFIX%:${nfsPrefix}:g" ${domainPVOutput}

kubernetes/internal/weblogic-domain-persistent-volume-template.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ spec:
1313
storage: %WEBLOGIC_DOMAIN_STORAGE_SIZE%
1414
accessModes:
1515
- ReadWriteMany
16-
persistentVolumeReclaimPolicy: Retain
16+
# Valid values are Retain, Delete or Recycle
17+
persistentVolumeReclaimPolicy: %WEBLOGIC_DOMAIN_STORAGE_RECLAIM_POLICY%
1718
%HOST_PATH_PREFIX%hostPath:
1819
%NFS_PREFIX%nfs:
1920
%NFS_PREFIX%server: %WEBLOGIC_DOMAIN_STORAGE_NFS_SERVER%

site/creating-domain.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,7 @@ The following parameters must be provided in the input file:
120120
| t3PublicAddress | Public address for the t3 channel. | kubernetes |
121121
| weblogicCredentialsSecretName | Name of the Kubernetes secret for the Administration Server's username and password. | domain1-weblogic-credentials |
122122
| weblogicDomainStoragePath | Physical path of the storage for the domain. | no default |
123+
| weblogicDomainStorageReclaimPolicy | Kubernetes persistent volume reclaim policy for the domain persistent storage | Retain |
123124
| weblogicDomainStorageSize | Total storage allocated for the domain. | 10Gi |
124125
| weblogicDomainStorageType | Type of storage for the domain. Legal values are 'NFS' and 'HOST_PATH". | HOST_PATH |
125126
| weblogicDomainStorageNFSServer| The name of IP address of the NFS server for the domain's storage. | no default |

site/name-changes.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,11 +50,11 @@ Similarly, the per-domain directory name is:
5050

5151
#### What If I Mess Up Creating a Domain or Operator And Want To Do It Again?
5252

53+
* Remove the resources that were created for the domain:
54+
* kubernetes/delete-weblogic-domain-resources.sh yourDomainUID
5355
* Remove the resources that were created for the operator:
5456
* kubectl delete -f weblogic-operator.yaml
5557
* kubectl delete -f weblogic-operator-security.yaml
56-
* Remove the resources that were created for the domain:
57-
* kubernetes/delete-weblogic-domain-resources.sh yourDomainUID
5858
* either remove the directory that was generated for that operator / domain, or remove the generated YAML files and the copy of the input file from it
5959
* make whatever changes you need in your inputs file
6060
* re-run the create script

src/integration-tests/bash/cleanup.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ OCOUNT=${#OPER_NAMESPACES[@]}
5151
SCRIPTPATH="$( cd "$(dirname "$0")" > /dev/null 2>&1 ; pwd -P )"
5252
PROJECT_ROOT="$SCRIPTPATH/../../.."
5353
RESULT_ROOT=${RESULT_ROOT:-/scratch/$USER/wl_k8s_test_results}
54+
PV_ROOT=${PV_ROOT:-$RESULT_ROOT}
5455
RESULT_DIR="$RESULT_ROOT/acceptance_test_tmp"
5556
USER_PROJECTS_DIR="$RESULT_DIR/user-projects"
5657
TMP_DIR="$RESULT_DIR/cleanup_tmp"

0 commit comments

Comments
 (0)