Skip to content

Commit

Permalink
Delete the ServiceMonitor CR only if its CRD exists (#139)
Browse files Browse the repository at this point in the history
Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe authored Nov 15, 2023
1 parent eb499d6 commit 45b220b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,9 @@ deploy)
fi
;;
undeploy)
$KUSTOMIZE build config/prometheus | kubectl delete --ignore-not-found -f-
if kubectl get crd servicemonitors.monitoring.coreos.com > /dev/null 2>&1; then
$KUSTOMIZE build config/prometheus | kubectl delete --ignore-not-found -f-
fi
# When the NnfDataMovementManager CRD gets deleted all related resource are also
# removed, so the delete will always fail. We ignore all errors at our
# own risk.
Expand Down

0 comments on commit 45b220b

Please sign in to comment.