Skip to content

Commit 7293a0d

Browse files
authored
Support new structure in WDT archive for database wallets (#4049)
* Fix an error wallet not expanded in MII due to new possible zip format of wallet in the archive
1 parent 4386a95 commit 7293a0d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

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

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1290,7 +1290,7 @@ restorAppAndLibs() {
12901290
# exclude standalone app module in wlsdeploy/applications/*.xml since it is included int zipped up domain config
12911291
# zip, the original xml in the archive may have wdt tokenized notations.
12921292
cd ${DOMAIN_HOME} || return 1
1293-
unzip ${IMG_ARCHIVES_ROOTDIR}/${file} -x "wlsdeploy/domainBin/*"
1293+
unzip -o ${IMG_ARCHIVES_ROOTDIR}/${file} -x "wlsdeploy/domainBin/*"
12941294
if [ $? -ne 0 ] ; then
12951295
trace SEVERE "Domain Source Type is FromModel, error in extracting application archive ${IMG_ARCHIVES_ROOTDIR}/${file}"
12961296
return 1
@@ -1299,6 +1299,15 @@ restorAppAndLibs() {
12991299

13001300
}
13011301

1302+
#
1303+
restoreZippedDbWallets() {
1304+
local count=$(find ${DOMAIN_HOME}/wlsdeploy/dbWallets/*/*.zip -type f 2>/dev/null | wc -l)
1305+
if [ "$count" -gt 0 ] ; then
1306+
find ${DOMAIN_HOME}/wlsdeploy/dbWallets/*/*.zip -type f | xargs -I % sh -c 'unzip -jo % -d $(dirname %) ; rm %'
1307+
fi
1308+
}
1309+
1310+
13021311
prepareMIIServer() {
13031312

13041313
trace "Model-in-Image: Creating domain home."
@@ -1341,6 +1350,9 @@ prepareMIIServer() {
13411350
trace "Model-in-Image: Restore domain config"
13421351
restoreDomainConfig || return 1
13431352

1353+
trace "Model-in-image: Restore dbWallets zip"
1354+
1355+
restoreZippedDbWallets || return 1
13441356
return 0
13451357
}
13461358

0 commit comments

Comments
 (0)