Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Skip ClusterServingRuntime deletion if deployed using --namespace-scope-mode #421

Merged
merged 6 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion scripts/delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -131,9 +131,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)
rafvasq marked this conversation as resolved.
Show resolved Hide resolved
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 ]]; then
rafvasq marked this conversation as resolved.
Show resolved Hide resolved
kustomize build runtimes --load_restrictor none | kubectl apply -f -
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