Skip to content

Commit

Permalink
Merge branch 'upgrade14120-fixes' into 'main'
Browse files Browse the repository at this point in the history
Upgrade14120 fixes

See merge request weblogic-cloud/weblogic-kubernetes-operator!4800
  • Loading branch information
rjeberhard committed Sep 6, 2024
2 parents f07f0e0 + 2f8286c commit 6a1db4c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 11 deletions.
12 changes: 5 additions & 7 deletions operator/src/main/resources/scripts/modelInImage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -399,13 +399,12 @@ createWLDomain() {
if [ -f ${PRIMORDIAL_DOMAIN_ZIPPED} ] ; then
checkSecureModeForUpgrade
fi

if [ ${WDT_ARTIFACTS_CHANGED} -ne 0 ] || [ ${jdk_changed} -eq 1 ] \
|| [ ${SECRETS_AND_ENV_CHANGED} -ne 0 ] || [ ${DISABLE_SM_FOR_12214_NONSM_UPG} -eq 1 ] ; then

trace "Need to create domain ${WDT_DOMAIN_TYPE}"
createModelDomain
if [ "${MERGED_MODEL_ENVVARS_SAME}" == "false" ] ; then
if [ "${MERGED_MODEL_ENVVARS_SAME}" == "false" ] || [ ${DISABLE_SM_FOR_12214_NONSM_UPG} -eq 1 ] ; then
# Make sure it will run the introspectDomain.py
DOMAIN_CREATED=1
fi
else
Expand Down Expand Up @@ -500,7 +499,8 @@ createModelDomain() {
trace "Entering createModelDomain"
createPrimordialDomain

if [ "${MERGED_MODEL_ENVVARS_SAME}" == "false" ] ; then
# If model changes or upgrade image scenario, run update domain.
if [ "${MERGED_MODEL_ENVVARS_SAME}" == "false" ] || [ $DISABLE_SM_FOR_12214_NONSM_UPG -eq 1 ] ; then
# if there is a new primordial domain created then use newly created primordial domain otherwise
# if the primordial domain already in the configmap, restore it
#
Expand Down Expand Up @@ -780,9 +780,6 @@ createPrimordialDomain() {

trace "No primordial domain or need to create again because of changes require domain recreation"

#if } -eq 1 ] && [ -f ${PRIMORDIAL_DOMAIN_ZIPPED} ]; then


wdtCreatePrimordialDomain
create_primordial_tgz=1
MII_USE_ONLINE_UPDATE=false
Expand Down Expand Up @@ -846,6 +843,7 @@ checkSecureModeForUpgrade() {
if [ -f /tmp/mii_domain_upgrade.txt ] && [ $(grep -i False /tmp/mii_domain_upgrade.txt | wc -l ) -gt 0 ] ; then
if [ -f /tmp/mii_domain_before14120.txt ] && [ $(grep -i True /tmp/mii_domain_before14120.txt | wc -l ) -gt 0 ] ; then
# Set this so that the upgrade image only scenario 12.2.1.4 to 14.1.2 will recreate the domain
trace "Domain version is earlier than 14.1.2, upgrade only image to 14.1.2 detected"
DISABLE_SM_FOR_12214_NONSM_UPG=1
fi
fi
Expand Down
14 changes: 10 additions & 4 deletions operator/src/main/resources/scripts/model_wdt_mii_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,9 @@ def filter_model(model):
try:

if model is not None:

upgradeServerIfNeeded(model)

if getOfflineWlstEnv() is None:
initOfflineWlstEnv(model)

Expand Down Expand Up @@ -216,7 +219,6 @@ def filter_model(model):
if 'ServerTemplate' in topology:
customizeServerTemplates(model)

upgradeServerIfNeeded(model)
except:
exc_type, exc_obj, exc_tb = sys.exc_info()
ee_string = traceback.format_exception(exc_type, exc_obj, exc_tb)
Expand Down Expand Up @@ -413,14 +415,18 @@ def upgradeServerIfNeeded(model):
# if domainInfo already set to secure or in dev mode then do not set it, prod mode will not be secure
# regardless of others
# if the model disabled `ProductionModeEnabled` specifically now, do nothing

prod_mode = False
if 'domainInfo' in model and 'ServerStartMode' in model['domainInfo']:
return
mode = model['domainInfo']['ServerStartMode']
if mode == 'secure' or mode == 'dev':
return
else:
prod_mode = True

if 'topology' in model:

topology = model['topology']
if 'ProductionModeEnabled' not in topology:
if not prod_mode and 'ProductionModeEnabled' not in topology:
return

if 'ProductionModeEnabled' in topology:
Expand Down

0 comments on commit 6a1db4c

Please sign in to comment.