3
3
# Licensed under the Universal Permissive License v 1.0 as shown at http://oss.oracle.com/licenses/upl.
4
4
#
5
5
# Description
6
- # This sample script creates a WebLogic domain home in docker image, and generates the domain custom resource
6
+ # This sample script creates a WebLogic domain home in docker image, and generates the domain resource
7
7
# yaml file, which can be used to restart the Kubernetes artifacts of the corresponding domain.
8
8
#
9
9
# The domain creation inputs can be customized by editing create-domain-inputs.yaml
@@ -116,46 +116,6 @@ function validateDomainSecret {
116
116
failIfValidationErrors
117
117
}
118
118
119
- #
120
- # Function to validate the weblogic image pull policy
121
- #
122
- function validateWeblogicImagePullPolicy {
123
- if [ ! -z ${imagePullPolicy} ]; then
124
- case ${imagePullPolicy} in
125
- " IfNotPresent" )
126
- ;;
127
- " Always" )
128
- ;;
129
- " Never" )
130
- ;;
131
- * )
132
- validationError " Invalid value for imagePullPolicy: ${imagePullPolicy} . Valid values are IfNotPresent, Always, and Never."
133
- ;;
134
- esac
135
- else
136
- # Set the default
137
- imagePullPolicy=" IfNotPresent"
138
- fi
139
- failIfValidationErrors
140
- }
141
-
142
- #
143
- # Function to validate the weblogic image pull secret name
144
- #
145
- function validateWeblogicImagePullSecretName {
146
- if [ ! -z ${imagePullSecretName} ]; then
147
- validateLowerCase imagePullSecretName ${imagePullSecretName}
148
- imagePullSecretPrefix=" "
149
- if [ " ${generateOnly} " = false ]; then
150
- validateWeblogicImagePullSecret
151
- fi
152
- else
153
- # Set name blank when not specified, and comment out the yaml
154
- imagePullSecretName=" "
155
- imagePullSecretPrefix=" #"
156
- fi
157
- }
158
-
159
119
#
160
120
# Function to validate a kubernetes secret exists
161
121
# $1 - the name of the secret
@@ -168,16 +128,6 @@ function validateSecretExists {
168
128
fi
169
129
}
170
130
171
- #
172
- # Function to validate the weblogic image pull secret exists
173
- #
174
- function validateWeblogicImagePullSecret {
175
- # The kubernetes secret for pulling images from the docker store is optional.
176
- # If it was specified, make sure it exists.
177
- validateSecretExists ${imagePullSecretName} ${namespace}
178
- failIfValidationErrors
179
- }
180
-
181
131
# try to execute docker to see whether docker is available
182
132
function validateDockerAvailable {
183
133
if ! [ -x " $( command -v docker) " ]; then
@@ -215,7 +165,7 @@ function initialize {
215
165
216
166
dcrInput=" ${scriptDir} /domain-template.yaml"
217
167
if [ ! -f ${dcrInput} ]; then
218
- validationError " The template file ${dcrInput} for creating the domain custom resource was not found"
168
+ validationError " The template file ${dcrInput} for creating the domain resource was not found"
219
169
fi
220
170
221
171
failIfValidationErrors
@@ -230,7 +180,6 @@ function initialize {
230
180
managedServerNameBase \
231
181
namespace \
232
182
t3PublicAddress \
233
- includeServerOutInPodLog \
234
183
version
235
184
236
185
validateIntegerInputParamsSpecified \
@@ -256,8 +205,6 @@ function initialize {
256
205
validateManagedServerNameBase
257
206
validateClusterName
258
207
validateWeblogicCredentialsSecretName
259
- validateWeblogicImagePullPolicy
260
- validateWeblogicImagePullSecretName
261
208
initAndValidateOutputDir
262
209
validateServerStartPolicy
263
210
validateClusterType
@@ -294,9 +241,6 @@ function createFiles {
294
241
295
242
domainName=${domainUID}
296
243
297
- # Must escape the ':' value in image for sed to properly parse and replace
298
- image=$( echo ${image} | sed -e " s/\:/\\ \:/g" )
299
-
300
244
# Generate the properties file that will be used when creating the weblogic domain
301
245
echo Generating ${domainPropertiesOutput}
302
246
@@ -314,7 +258,7 @@ function createFiles {
314
258
sed -i -e " s:%T3_CHANNEL_PORT%:${t3ChannelPort} :g" ${domainPropertiesOutput}
315
259
sed -i -e " s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress} :g" ${domainPropertiesOutput}
316
260
317
- # Generate the yaml to create the domain custom resource
261
+ # Generate the yaml to create the domain resource
318
262
echo Generating ${dcrOutput}
319
263
320
264
if [ " ${exposeAdminT3Channel} " = true ]; then
@@ -402,14 +346,14 @@ function printSummary {
402
346
}
403
347
404
348
#
405
- # Function to create the domain custom resource
349
+ # Function to create the domain resource
406
350
#
407
351
function createDomainResource {
408
352
pwd
409
353
kubectl apply -f ${dcrOutput}
410
354
DCR_AVAIL=` kubectl get domain -n ${namespace} | grep ${domainUID} | wc | awk ' { print $1; } ' `
411
355
if [ " ${DCR_AVAIL} " != " 1" ]; then
412
- fail " The domain custom resource ${domainUID} was not found"
356
+ fail " The domain resource ${domainUID} was not found"
413
357
fi
414
358
}
415
359
0 commit comments