Skip to content

Commit

Permalink
Merge branch 'main' into fix_delete_script
Browse files Browse the repository at this point in the history
  • Loading branch information
Jooho authored Sep 12, 2023
2 parents 16c5090 + 5dfc278 commit 4cc1ae5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
8 changes: 7 additions & 1 deletion scripts/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,15 @@ if [[ "$crb_ns" == "$namespace" ]]; then
echo "deleting cluster scope RBAC"
kustomize build rbac/cluster-scope | kubectl delete -f - --ignore-not-found=true
fi

# Determine whether deployment is namespace-scoped before deleting runtime resources
is_namespace_scoped=$(kubectl exec deploy/modelmesh-controller -- printenv NAMESPACE_SCOPE 2> /dev/null || echo "false") || :
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 [[ ! "$is_namespace_scoped" == "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

Expand Down
2 changes: 2 additions & 0 deletions scripts/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4cc1ae5

Please sign in to comment.