Skip to content

Commit 15e244c

Browse files
committed
minor change, delete useless code
1 parent 015701b commit 15e244c

File tree

1 file changed

+5
-61
lines changed
  • kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image

1 file changed

+5
-61
lines changed

kubernetes/samples/scripts/create-weblogic-domain/domain-home-in-image/create-domain.sh

Lines changed: 5 additions & 61 deletions
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
# 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
77
# yaml file, which can be used to restart the Kubernetes artifacts of the corresponding domain.
88
#
99
# The domain creation inputs can be customized by editing create-domain-inputs.yaml
@@ -116,46 +116,6 @@ function validateDomainSecret {
116116
failIfValidationErrors
117117
}
118118

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-
159119
#
160120
# Function to validate a kubernetes secret exists
161121
# $1 - the name of the secret
@@ -168,16 +128,6 @@ function validateSecretExists {
168128
fi
169129
}
170130

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-
181131
# try to execute docker to see whether docker is available
182132
function validateDockerAvailable {
183133
if ! [ -x "$(command -v docker)" ]; then
@@ -215,7 +165,7 @@ function initialize {
215165

216166
dcrInput="${scriptDir}/domain-template.yaml"
217167
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"
219169
fi
220170

221171
failIfValidationErrors
@@ -230,7 +180,6 @@ function initialize {
230180
managedServerNameBase \
231181
namespace \
232182
t3PublicAddress \
233-
includeServerOutInPodLog \
234183
version
235184

236185
validateIntegerInputParamsSpecified \
@@ -256,8 +205,6 @@ function initialize {
256205
validateManagedServerNameBase
257206
validateClusterName
258207
validateWeblogicCredentialsSecretName
259-
validateWeblogicImagePullPolicy
260-
validateWeblogicImagePullSecretName
261208
initAndValidateOutputDir
262209
validateServerStartPolicy
263210
validateClusterType
@@ -294,9 +241,6 @@ function createFiles {
294241

295242
domainName=${domainUID}
296243

297-
# Must escape the ':' value in image for sed to properly parse and replace
298-
image=$(echo ${image} | sed -e "s/\:/\\\:/g")
299-
300244
# Generate the properties file that will be used when creating the weblogic domain
301245
echo Generating ${domainPropertiesOutput}
302246

@@ -314,7 +258,7 @@ function createFiles {
314258
sed -i -e "s:%T3_CHANNEL_PORT%:${t3ChannelPort}:g" ${domainPropertiesOutput}
315259
sed -i -e "s:%T3_PUBLIC_ADDRESS%:${t3PublicAddress}:g" ${domainPropertiesOutput}
316260

317-
# Generate the yaml to create the domain custom resource
261+
# Generate the yaml to create the domain resource
318262
echo Generating ${dcrOutput}
319263

320264
if [ "${exposeAdminT3Channel}" = true ]; then
@@ -402,14 +346,14 @@ function printSummary {
402346
}
403347

404348
#
405-
# Function to create the domain custom resource
349+
# Function to create the domain resource
406350
#
407351
function createDomainResource {
408352
pwd
409353
kubectl apply -f ${dcrOutput}
410354
DCR_AVAIL=`kubectl get domain -n ${namespace} | grep ${domainUID} | wc | awk ' { print $1; } '`
411355
if [ "${DCR_AVAIL}" != "1" ]; then
412-
fail "The domain custom resource ${domainUID} was not found"
356+
fail "The domain resource ${domainUID} was not found"
413357
fi
414358
}
415359

0 commit comments

Comments
 (0)