@@ -282,13 +282,14 @@ jobs:
282
282
az aks get-credentials --resource-group ${{ needs.preflight.outputs.resourceGroupForWlsAks }} --name $aksClusterName
283
283
- name : Generate&Apply configmap
284
284
run : |
285
+ wlsDomainNS=sample-domain1-ns
285
286
wlsConfigmapName=sample-domain1-wdt-config-map
286
287
wlsConfigmapJson=cargo-tracker-db.json
287
288
modelFilePath=models
288
289
mkdir ${modelFilePath}
289
290
echo "create configmap"
290
291
echo "export exisiting configmap"
291
- kubectl -n sample-domain1-ns get configmap ${wlsConfigmapName} -o json >${wlsConfigmapJson}
292
+ kubectl -n ${wlsDomainNS} get configmap ${wlsConfigmapName} -o json >${wlsConfigmapJson}
292
293
293
294
echo "query model keys"
294
295
keyList=$(cat ${wlsConfigmapJson} | jq '.data | keys[]' | tr -d "\"")
@@ -299,24 +300,25 @@ jobs:
299
300
done
300
301
301
302
# remove current configmap and create a new one
302
- kubectl -n sample-domain1-ns delete configmap ${wlsConfigmapName}
303
+ kubectl -n ${wlsDomainNS} delete configmap ${wlsConfigmapName}
303
304
304
305
cp cargotracker/src/test/aks/cargo-tracker-jms.yaml ${modelFilePath}/cargo-tracker-jms.yaml
305
306
306
- kubectl -n sample-domain1-ns create configmap ${wlsConfigmapName} \
307
+ kubectl -n ${wlsDomainNS} create configmap ${wlsConfigmapName} \
307
308
--from-file=${modelFilePath}
308
309
309
- kubectl -n sample-domain1-ns label configmap ${wlsConfigmapName} \
310
+ kubectl -n ${wlsDomainNS} label configmap ${wlsConfigmapName} \
310
311
weblogic.domainUID=sample-domain1
311
- restartVersion=$(kubectl -n sample-domain1-ns get domain sample-domain1 '-o=jsonpath={.spec.restartVersion}')
312
+ restartVersion=$(kubectl -n ${wlsDomainNS} get domain sample-domain1 '-o=jsonpath={.spec.restartVersion}')
312
313
# increase restart version
313
314
restartVersion=$((restartVersion + 1))
314
315
# record timestamp before apply changes
315
316
timestampBeforePatchingDomain=$(date +%s)
316
- # get the replica number
317
- replicas=$(kubectl -n sample-domain1-ns get domain sample-domain1 -o json | jq '. | .spec.clusters[] | .replicas')
317
+ # get the replica number
318
+ clusterName=$(kubectl get cluster -n ${wlsDomainNS} -o json | jq -r '.items[0].metadata.name')
319
+ replicas=$(kubectl -n ${wlsDomainNS} get cluster ${clusterName} -o json | jq '. | .spec.replicas')
318
320
echo "append configmap and update restart version"
319
- kubectl -n sample-domain1-ns patch domain sample-domain1 \
321
+ kubectl -n ${wlsDomainNS} patch domain sample-domain1 \
320
322
--type=json \
321
323
'-p=[{"op": "replace", "path": "/spec/restartVersion", "value": "'${restartVersion}'" }, {"op": "add", "path": "/spec/configuration/model/configMap", "value": "'${wlsConfigmapName}'" }]'
322
324
echo "timestampBeforePatchingDomain=${timestampBeforePatchingDomain}" >> $GITHUB_ENV
0 commit comments