Skip to content

Commit 1f8705f

Browse files
committed
merge fixes
1 parent e78377c commit 1f8705f

File tree

5 files changed

+58
-15
lines changed

5 files changed

+58
-15
lines changed

kubernetes/create-domain-job.sh

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -147,11 +147,12 @@ function validateDomainSecret {
147147
# Function to validate the image pull secret name
148148
#
149149
function validateImagePullSecretName {
150-
IMAGE_PULL_SECRET_EXISTS=false
151150
if [ ! -z ${imagePullSecretName} ]; then
152151
validateLowerCase ${imagePullSecretName} "validateImagePullSecretName"
153-
IMAGE_PULL_SECRET_EXISTS=true
154152
imagePullSecretPrefix=""
153+
if [ "${generateOnly}" = false ]; then
154+
validateImagePullSecret
155+
fi
155156
else
156157
# Set name blank when not specified, and comment out the yaml
157158
imagePullSecretName=""
@@ -166,10 +167,8 @@ function validateImagePullSecret {
166167

167168
# The kubernetes secret for pulling images from the docker store is optional.
168169
# If it was specified, make sure it exists.
169-
if [ "${IMAGE_PULL_SECRET_EXISTS}" = true ]; then
170-
validateSecretExists ${imagePullSecretName} ${namespace}
171-
failIfValidationErrors
172-
fi
170+
validateSecretExists ${imagePullSecretName} ${namespace}
171+
failIfValidationErrors
173172
}
174173

175174
#
@@ -557,9 +556,6 @@ if [ "${generateOnly}" = false ]; then
557556
# Check that the domain secret exists and contains the required elements
558557
validateDomainSecret
559558

560-
# Check if the optional docker secret exists
561-
validateImagePullSecret
562-
563559
# Create the persistent volume
564560
createPV
565561

kubernetes/create-operator-inputs.yaml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,15 @@ namespace: weblogic-operator
1717
targetNamespaces: default
1818

1919
# The docker image containing the operator code.
20-
image: wlsldi-v2.docker.oraclecorp.com/weblogic-operator:latest
20+
image: container-registry.oracle.com/middleware/weblogic-kubernetes-operator:latest
2121

2222
# The image pull policy for the operator docker image.
2323
imagePullPolicy: IfNotPresent
2424

25+
# Name of the Kubernetes secret to access the registry containing the operator Docker image
26+
# The presence of the secret will be validated when this parameter is enabled.
27+
#imagePullSecretName:
28+
2529
# Options for externally exposing the operator REST https interface
2630
# (i.e. outside of the Kubernetes cluster). Valid values are:
2731
#

kubernetes/create-weblogic-operator.sh

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,51 @@ function initialize {
9595
validateJavaLoggingLevel
9696

9797
validateExternalRest
98+
99+
validateImagePullSecretName
98100

99101
failIfValidationErrors
100102
}
101103

104+
#
105+
# Function to validate the image pull secret name
106+
#
107+
function validateImagePullSecretName {
108+
if [ ! -z ${imagePullSecretName} ]; then
109+
validateLowerCase ${imagePullSecretName} "validateImagePullSecretName"
110+
imagePullSecretPrefix=""
111+
validateImagePullSecret
112+
else
113+
# Set name blank when not specified, and comment out the yaml
114+
imagePullSecretName=""
115+
imagePullSecretPrefix="#"
116+
fi
117+
}
118+
119+
#
120+
# Function to validate the image pull secret exists
121+
#
122+
function validateImagePullSecret {
123+
124+
# The kubernetes secret for pulling images from the docker store is optional.
125+
# If it was specified, make sure it exists.
126+
validateSecretExists ${imagePullSecretName} ${namespace}
127+
failIfValidationErrors
128+
}
129+
130+
#
131+
# Function to validate a kubernetes secret exists
132+
# $1 - the name of the secret
133+
# $2 - namespace
134+
function validateSecretExists {
135+
# Verify the secret exists
136+
echo "Checking to see if the secret ${1} exists in namespace ${2}"
137+
local SECRET=`kubectl get secret ${1} -n ${2} | grep ${1} | wc | awk ' { print $1; }'`
138+
if [ "${SECRET}" != "1" ]; then
139+
validationError "The registry secret ${1} was not found in namespace ${2}"
140+
fi
141+
}
142+
102143
#
103144
# Function to validate the service account is lowercase
104145
#
@@ -269,6 +310,8 @@ function createYamlFiles {
269310
sed -i -e "s|%ACCOUNT_NAME%|$serviceAccount|g" ${oprOutput}
270311
sed -i -e "s|%IMAGE%|$image|g" ${oprOutput}
271312
sed -i -e "s|%IMAGE_PULL_POLICY%|$imagePullPolicy|g" ${oprOutput}
313+
sed -i -e "s|%DOCKER_STORE_REGISTRY_SECRET%|${imagePullSecretName}|g" ${oprOutput}
314+
sed -i -e "s|%IMAGE_PULL_SECRET_PREFIX%|${imagePullSecretPrefix}|g" ${oprOutput}
272315
sed -i -e "s|%EXTERNAL_OPERATOR_SERVICE_PREFIX%|$externalOperatorServicePrefix|g" ${oprOutput}
273316
sed -i -e "s|%EXTERNAL_REST_HTTPS_PORT%|$externalRestHttpsPort|g" ${oprOutput}
274317
sed -i -e "s|%EXTERNAL_DEBUG_HTTP_PORT%|$externalDebugHttpPort|g" ${oprOutput}

kubernetes/internal/domain-job-template.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ data:
177177
sleep 15
178178
echo "Finished waiting for the nodemanager to start"
179179
180-
echo "Update JVM arguments"
180+
echo "Update JVM arguments"
181181
echo "Arguments=\${USER_MEM_ARGS} -XX\:+UnlockExperimentalVMOptions -XX\:+UseCGroupMemoryLimitForHeap \${JAVA_OPTIONS}" >> ${startProp}
182182
183183
echo "Start the server"
@@ -207,7 +207,7 @@ data:
207207
checkFileExists ${pyFile}
208208
209209
# Create a liveness probe script. It checks a WL server state file maintained by the node manager.
210-
# The script and 'EOF' on the following lines must not be indented!
210+
# The script and 'EOF' on the following lines must not be indented!
211211
212212
scriptFile=${nmdir}/livenessProbe.sh
213213
@@ -317,7 +317,7 @@ data:
317317
done
318318
319319
echo "Successfully Completed"
320-
320+
321321
create-domain.py: |-
322322
# This python script is used to create a WebLogic domain
323323

kubernetes/internal/generate-security-policy.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ else
4444
shift
4545
fi
4646

47-
if [ "$1" == "-o" ] ; then
47+
if [ "$1" = "-o" ] ; then
4848
shift
4949
SCRIPT="$1"
50-
elif [[ "$1" = --output=* ]] ; then
50+
elif [[ "$1" = "--output="* ]] ; then
5151
SCRIPT=`echo "$1" | cut -d \= -f 2`
5252
else
5353
SCRIPT=$SCRIPT_DEFAULT

0 commit comments

Comments
 (0)