-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremove-devspaces.sh
executable file
·34 lines (34 loc) · 2.21 KB
/
remove-devspaces.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
set -x
oc get checluster --all-namespaces -o=jsonpath="{.items[*].metadata.namespace}"
~/Projects/CRW/dsc/bin/dsc version
~/Projects/CRW/dsc/bin/dsc server:delete -n openshift-devspaces
oc delete devworkspaces.workspace.devfile.io --all-namespaces --selector 'console.openshift.io/terminal=true' --wait
oc delete devworkspacetemplates.workspace.devfile.io --all-namespaces --selector 'console.openshift.io/terminal=true' --wait
oc delete devworkspaces.workspace.devfile.io --all-namespaces --all --wait
oc delete devworkspaceroutings.controller.devfile.io --all-namespaces --all
oc delete customresourcedefinitions.apiextensions.k8s.io devworkspaceroutings.controller.devfile.io
oc delete customresourcedefinitions.apiextensions.k8s.io devworkspaces.workspace.devfile.io
oc delete customresourcedefinitions.apiextensions.k8s.io devworkspacetemplates.workspace.devfile.io
oc delete customresourcedefinitions.apiextensions.k8s.io devworkspaceoperatorconfigs.controller.devfile.io
# oc get customresourcedefinitions.apiextensions.k8s.io | grep "devfile.io"
oc delete deployment/devworkspace-webhook-server -n openshift-devspaces
oc delete deployment/devworkspace-webhook-server -n openshift-operators
oc delete mutatingwebhookconfigurations controller.devfile.io
oc delete validatingwebhookconfigurations controller.devfile.io
oc delete all --selector app.kubernetes.io/part-of=devworkspace-operator,app.kubernetes.io/name=devworkspace-webhook-server -n openshift-devspaces
oc delete all --selector app.kubernetes.io/part-of=devworkspace-operator,app.kubernetes.io/name=devworkspace-webhook-server -n openshift-operators
oc delete serviceaccounts devworkspace-webhook-server -n openshift-devspaces
oc delete configmap devworkspace-controller -n openshift-devspaces
oc delete serviceaccounts devworkspace-webhook-server -n openshift-operators
oc delete configmap devworkspace-controller -n openshift-operators
oc delete clusterrole devworkspace-webhook-server
oc delete clusterrolebinding devworkspace-webhook-server
oc delete project openshift-devspaces
# delete user projects
for i in {1..5}
do
oc delete project user${i}-devspaces
done
#
echo "Now uninstall the Dev WorkSpace Operator"
~/Projects/CRW/dsc/bin/dsc server:delete -n openshift-devspaces --delete-all