diff --git a/scripts/delete.sh b/scripts/delete.sh index a8ebbfa54..b1ee819c9 100755 --- a/scripts/delete.sh +++ b/scripts/delete.sh @@ -133,11 +133,13 @@ if [[ "$crb_ns" == "$namespace" ]]; then fi kustomize build default | kubectl delete -f - --ignore-not-found=true kustomize build rbac/namespace-scope | kubectl delete -f - --ignore-not-found=true -kustomize build runtimes ${kustomize_load_restrictor_arg} | kubectl delete -f - --ignore-not-found=true +if [[ $(kubectl exec deploy/modelmesh-controller -- printenv NAMESPACE_SCOPE) == true ]]; then + kustomize build runtimes ${kustomize_load_restrictor_arg} | kubectl delete -f - --ignore-not-found=true +fi kubectl delete -f dependencies/quickstart.yaml --ignore-not-found=true kubectl delete -f dependencies/fvt.yaml --ignore-not-found=true # Roll back to previous status if [[ "$namespace" != "$old_namespace" ]]; then kubectl config set-context --current --namespace=${old_namespace} -fi +fi \ No newline at end of file diff --git a/scripts/install.sh b/scripts/install.sh index b9d1fafef..5cd0f0cca 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -351,6 +351,8 @@ if [[ $namespace_scope_mode == "true" ]]; then # Reset crd/kustomization.yaml back to CSR crd since we used the same file for namespace scope mode installation sed -i.bak 's/#- bases\/serving.kserve.io_clusterservingruntimes.yaml/- bases\/serving.kserve.io_clusterservingruntimes.yaml/g' crd/kustomization.yaml rm crd/kustomization.yaml.bak +else + kubectl set env deploy/modelmesh-controller NAMESPACE_SCOPE=false fi if [[ -n $modelmesh_serving_image ]]; then