Skip to content

Commit 5851ba6

Browse files
committed
minor changes based on code review
1 parent 4c8ec57 commit 5851ba6

File tree

6 files changed

+56
-15
lines changed

6 files changed

+56
-15
lines changed

operator/src/main/java/oracle/kubernetes/operator/helpers/PodStepContext.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
import oracle.kubernetes.operator.work.Step;
6262
import oracle.kubernetes.weblogic.domain.model.Domain;
6363
import oracle.kubernetes.weblogic.domain.model.DomainStatus;
64+
import oracle.kubernetes.weblogic.domain.model.IntrospectorJobEnvVars;
6465
import oracle.kubernetes.weblogic.domain.model.ServerEnvVars;
6566
import oracle.kubernetes.weblogic.domain.model.ServerSpec;
6667
import oracle.kubernetes.weblogic.domain.model.Shutdown;
@@ -631,6 +632,11 @@ private void updateEnv(List<V1EnvVar> env) {
631632
updateEnvForShutdown(env);
632633
updateEnvForStartupMode(env);
633634
defineConfigOverride(env);
635+
updateEnvWithDomainSourceType(env);
636+
}
637+
638+
private void updateEnvWithDomainSourceType(List<V1EnvVar> env) {
639+
addDefaultEnvVarIfMissing(env, IntrospectorJobEnvVars.DOMAIN_SOURCE_TYPE, getDomainHomeSourceType().toString());
634640
}
635641

636642
private void updateEnvForShutdown(List<V1EnvVar> env) {

operator/src/main/resources/scripts/livenessProbe.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ if [ $? != 0 ]; then
102102
exit $RETVAL
103103
fi
104104

105-
if [ ! -f /weblogic-operator/introspector/domainzip.secure ]; then
105+
if [ ${DOMAIN_SOURCE_TYPE} != "FromModel" ]; then
106106
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig 'Sit-Cfg-CFG--'
107107
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/jms 'Sit-Cfg-JMS--'
108108
copySitCfgWhileRunning /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/jdbc 'Sit-Cfg-JDBC--'

operator/src/main/resources/scripts/modelInImage.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -801,8 +801,7 @@ function generateMergedModel() {
801801

802802
trace "About to call '${WDT_BINDIR}/validateModel.sh ${wdtArgs}'."
803803

804-
${WDT_BINDIR}/validateModel.sh -oracle_home ${ORACLE_HOME} ${model_list} \
805-
${archive_list} ${variable_list} -domain_type ${WDT_DOMAIN_TYPE} > ${WDT_OUTPUT} 2>&1
804+
${WDT_BINDIR}/validateModel.sh ${wdtArgs} > ${WDT_OUTPUT} 2>&1
806805
ret=$?
807806
if [ $ret -ne 0 ]; then
808807
trace SEVERE "Model in Image: the WDT validate model tool detected an error with the fully merged model:"
@@ -934,8 +933,7 @@ function wdtUpdateModelDomain() {
934933

935934
trace "About to call '${WDT_BINDIR}/updateDomain.sh ${wdtArgs}'."
936935

937-
${WDT_BINDIR}/updateDomain.sh -oracle_home ${ORACLE_HOME} -domain_home ${DOMAIN_HOME} $model_list \
938-
${archive_list} ${variable_list} -domain_type ${WDT_DOMAIN_TYPE} ${UPDATE_RCUPWD_FLAG} > ${WDT_OUTPUT} 2>&1
936+
${WDT_BINDIR}/updateDomain.sh ${wdtArgs} > ${WDT_OUTPUT} 2>&1
939937
ret=$?
940938

941939
if [ $ret -ne 0 ]; then

operator/src/main/resources/scripts/model_wdt_mii_filter.py

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,46 @@
44
# ------------
55
# Description:
66
# ------------
7-
# This is a model-in-image WDT filter for overriding WLS configuration, it
8-
# replaces 'situational configuration overrides'.
7+
# This is a model-in-image WDT filter for overriding WLS configuration, it
8+
# replaces 'situational configuration overrides'.
99
#
10+
# This code is used by the operator during introspection for MII to manipulate
11+
# the domain model. It generates domain configuration information that's
12+
# useful for running the domain, setting up its networking, and for overriding
13+
# specific parts of its configuration so that it can run in k8s.
14+
#
15+
# For more details, see the Model Filters description in the WebLogic Deploy
16+
# Tooling in Github.
17+
#
18+
# ---------------------
19+
# Prerequisites/Inputs:
20+
# ---------------------
21+
#
22+
# A domain model as a Jython dictionary.
23+
#
24+
# The following env vars are required:
25+
# DOMAIN_UID - completely unique id for this domain
26+
# DOMAIN_HOME - path for the domain configuration
27+
# LOG_HOME - path to override WebLogic server log locations
28+
# CREDENTIALS_SECRET_NAME - name of secret containing credentials
29+
#
30+
# The following env vars are optional:
31+
# ACCESS_LOG_IN_LOG_HOME - HTTP access log files will be written to
32+
# the logHome directory.
33+
# DATA_HOME - in-pod location for data storage of default and custom file
34+
# stores.
35+
# CREDENTIALS_SECRET_PATH - directory path to secret containing credentials
36+
#
37+
# ---------------------------------
38+
# Result
39+
# ---------------------------------
40+
#
41+
# The configuration overrides are directly modified in the domain model and
42+
# include listen addresses, log file locations, etc. The WebLogic Deploy
43+
# Tooling will then generate/update the domain with the appropriate
44+
# configuration.
45+
#
46+
1047

1148
import inspect
1249
import os
@@ -162,10 +199,10 @@ def customizeServerTemplates(model):
162199
template_names = serverTemplates.keys()
163200
if template_names is not None:
164201
for template_name in template_names:
165-
template = serverTemplates[template_name]
166-
cluster_name = getClusterNameOrNone(template)
167-
if cluster_name is not None:
168-
customizeServerTemplate(topology, template)
202+
template = serverTemplates[template_name]
203+
cluster_name = getClusterNameOrNone(template)
204+
if cluster_name is not None:
205+
customizeServerTemplate(topology, template)
169206

170207

171208
def customizeServerTemplate(topology, template):

operator/src/main/resources/scripts/startNodeManager.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ if [ ! "${SERVER_NAME}" = "introspector" ]; then
241241
[ ! $? -eq 0 ] && trace SEVERE "Could not remove stale file '$wl_state_file'." && exit 1
242242
fi
243243

244-
if [ -f /weblogic-operator/introspector/domainzip.secure ]; then
244+
if [ ${DOMAIN_SOURCE_TYPE} == "FromModel" ]; then
245245
# Domain source type is 'FromModel' (MII) then disable Situation config override for WebLogic.
246246
failBootOnErrorOption=""
247247
else

operator/src/main/resources/scripts/startServer.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ function startWLS() {
102102

103103
FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR=${FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR:-true}
104104
SERVER_OUT_MONITOR_INTERVAL=${SERVER_OUT_MONITOR_INTERVAL:-3}
105-
if [ ! -f /weblogic-operator/introspector/domainzip.secure ]; then
105+
if [ ${DOMAIN_SOURCE_TYPE} != "FromModel" ]; then
106106
# If Domain source type is not FromModel (MII) then monitor server logs for invalid
107107
# Situational config override files.
108108
if [ ${FAIL_BOOT_ON_SITUATIONAL_CONFIG_ERROR} == 'true' ] ; then
@@ -178,7 +178,7 @@ traceDirs before DOMAIN_HOME LOG_HOME DATA_HOME
178178

179179
traceTiming "POD '${SERVICE_NAME}' MII UNZIP START"
180180

181-
if [ -f /weblogic-operator/introspector/domainzip.secure ]; then
181+
if [ ${DOMAIN_SOURCE_TYPE} == "FromModel" ]; then
182182
prepareMIIServer
183183
if [ $? -ne 0 ] ; then
184184
trace SEVERE "Domain Source Type is FromModel, unable to start the server, check other error messages in the log"
@@ -285,7 +285,7 @@ createFolder ${DOMAIN_HOME}/servers/${SERVER_NAME}/security
285285
copyIfChanged /weblogic-operator/introspector/boot.properties \
286286
${DOMAIN_HOME}/servers/${SERVER_NAME}/security/boot.properties
287287

288-
if [ ! -f /weblogic-operator/introspector/domainzip.secure ]; then
288+
if [ ${DOMAIN_SOURCE_TYPE} != "FromModel" ]; then
289289
trace "Copying situational configuration files from operator cm to ${DOMAIN_HOME}/optconfig directory"
290290
copySitCfgWhileBooting /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig 'Sit-Cfg-CFG--'
291291
copySitCfgWhileBooting /weblogic-operator/introspector ${DOMAIN_HOME}/optconfig/jms 'Sit-Cfg-JMS--'

0 commit comments

Comments
 (0)