forked from artemiscloud/activemq-artemis-jolokia-api-server
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathundeploy.sh
executable file
·20 lines (19 loc) · 1.02 KB
/
undeploy.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env sh
# find the cert-manager operator namespace, if this can't be retrived there's no
# possibility to proceed
certManagerNamespace=$(oc get Subscriptions --all-namespaces -ojson | jq -r '.items[] | select(.spec.name == "cert-manager") | .metadata.namespace')
if test -z "$certManagerNamespace"
then
certManagerNamespace=$(oc get Subscriptions --all-namespaces -ojson | jq -r '.items[] | select(.spec.name == "openshift-cert-manager-operator") | .metadata.namespace')
if test -z "$certManagerNamespace"
then
echo "cert-manager's namespace can't be determined, defaulting to default namespace"
certManagerNamespace="openshift-operators"
fi
fi
echo "cert-manager's namespace: $certManagerNamespace"
oc kustomize deploy \
| sed "s|namespace: openshift-operators|namespace: ${certManagerNamespace}|" \
| oc delete -f -
oc delete secret jolokia-api-server-selfsigned-ca-cert-secret -n activemq-artemis-jolokia-api-server
oc delete secret jolokia-api-server-selfsigned-ca-cert-secret -n ${certManagerNamespace}