Skip to content

Commit

Permalink
Fix mutatingwebhook not deleting error
Browse files Browse the repository at this point in the history
  • Loading branch information
ranikamadurawe committed Dec 4, 2019
1 parent 2c52459 commit 2102202
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions infrastructure/src/main/resources/kubernetes_destroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ function delete_resources() {
echo "running destroy.sh"
kubectl delete namespaces $namespace
kubectl delete mutatingwebhookconfiguration "sidecar-injector-webhook-cfg-${namespace}"
webhookadded=$(kubectl get mutatingwebhookconfiguration "sidecar-injector-webhook-cfg-${namespace}" -o jsonpath='{.status.conditions[?(@.type=="Available")].status}')
if [[ "$webhookadded" == "True" ]]
webhookadded=$(kubectl get mutatingwebhookconfiguration "sidecar-injector-webhook-cfg-${namespace}" -o json)
if [[ ! -z "$webhookadded" ]]
then
kubectl delete mutatingwebhookconfiguration "sidecar-injector-webhook-cfg-${namespace}"
fi
Expand Down
4 changes: 2 additions & 2 deletions infrastructure/src/main/resources/kubernetes_helmDestroy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,8 @@ read_property_file() {
function delete_resources() {
echo "running destroy.sh"
kubectl delete namespaces $namespace
webhookadded=$(kubectl get mutatingwebhookconfiguration "sidecar-injector-webhook-cfg-${namespace}" -o jsonpath='{.status.conditions[?(@.type=="Available")].status}')
if [[ "$webhookadded" == "True" ]]
webhookadded=$(kubectl get mutatingwebhookconfiguration "sidecar-injector-webhook-cfg-${namespace}" -o json)
if [[ ! -z "$webhookadded" ]]
then
kubectl delete mutatingwebhookconfiguration "sidecar-injector-webhook-cfg-${namespace}"
fi
Expand Down

0 comments on commit 2102202

Please sign in to comment.