@@ -775,7 +775,7 @@ function deploy_operator {
775
775
local outfile=" ${TMP_DIR} /create-weblogic-operator-helm.out"
776
776
trace " Run helm install to deploy the weblogic operator, see \" $outfile \" for tracking."
777
777
cd $PROJECT_ROOT /kubernetes/charts
778
- helm install weblogic-operator --name ${NAMESPACE } -f $inputs 2>&1 | opt_tee ${outfile}
778
+ helm install weblogic-operator --name ${opkey } -f $inputs 2>&1 | opt_tee ${outfile}
779
779
trace " helm install output:"
780
780
cat $outfile
781
781
operator_ready_wait $opkey
@@ -2487,6 +2487,27 @@ function test_domain_lifecycle {
2487
2487
declare_test_pass
2488
2488
}
2489
2489
2490
+ function wait_for_operator_shutdown {
2491
+ name=$1
2492
+ deleted=false
2493
+ iter=1
2494
+ trace " waiting for operator shutdown by verifying that namespace ${name} no longer exist "
2495
+ while [ ${deleted} == false -a $iter -lt 101 ]; do
2496
+ kubectl get namespace ${name}
2497
+ if [ $? != 0 ]; then
2498
+ deleted=true
2499
+ else
2500
+ iter=` expr $iter + 1`
2501
+ sleep 5
2502
+ fi
2503
+ done
2504
+ if [ ${deleted} == false ]; then
2505
+ fail ' operator fail to be deleted'
2506
+ else
2507
+ trace " operator namespace ${name} has been deleted"
2508
+ fi
2509
+ }
2510
+
2490
2511
function shutdown_operator {
2491
2512
if [ " $# " != 1 ] ; then
2492
2513
fail " requires 1 parameter: operatorKey"
@@ -2496,7 +2517,8 @@ function shutdown_operator {
2496
2517
local TMP_DIR=" ` op_get $OP_KEY TMP_DIR` "
2497
2518
2498
2519
if [ " $USE_HELM " = " true" ]; then
2499
- helm delete $OPERATOR_NS --purge
2520
+ helm delete $OP_KEY --purge
2521
+ wait_for_operator_shutdown $OPERATOR_NS
2500
2522
else
2501
2523
kubectl delete -f $TMP_DIR /weblogic-operator.yaml
2502
2524
fi
@@ -2522,7 +2544,7 @@ function startup_operator {
2522
2544
if [ " $USE_HELM " = " true" ]; then
2523
2545
local inputs=" $TMP_DIR /weblogic-operator-values.yaml"
2524
2546
local outfile=" $TMP_DIR /startup-weblogic-operator.out"
2525
- helm install weblogic-operator --name ${OPERATOR_NS } -f $inputs 2>&1 | opt_tee ${outfile}
2547
+ helm install weblogic-operator --name ${OP_KEY } -f $inputs 2>&1 | opt_tee ${outfile}
2526
2548
trace " helm install output:"
2527
2549
cat $outfile
2528
2550
else
@@ -2993,8 +3015,11 @@ function test_suite {
2993
3015
kubectl create namespace test1 2>&1 | sed ' s/^/+/g'
2994
3016
kubectl create namespace test2 2>&1 | sed ' s/^/+/g'
2995
3017
2996
- kubectl create namespace weblogic-operator-1 2>&1 | sed ' s/^/+/g'
2997
- kubectl create namespace weblogic-operator-2 2>&1 | sed ' s/^/+/g'
3018
+ if ! [ " $USE_HELM " = " true" ]; then
3019
+ # do not create ooperator namespace when using helm charts
3020
+ kubectl create namespace weblogic-operator-1 2>&1 | sed ' s/^/+/g'
3021
+ kubectl create namespace weblogic-operator-2 2>&1 | sed ' s/^/+/g'
3022
+ fi
2998
3023
2999
3024
# This test pass pairs with 'declare_new_test 1 define_operators_and_domains' above
3000
3025
declare_test_pass
0 commit comments