Skip to content

Commit

Permalink
Delete the ServiceMonitor CR only if its CRD exists
Browse files Browse the repository at this point in the history
Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe committed Nov 15, 2023
1 parent 9b94462 commit 1e2d915
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 1e2d915

Please sign in to comment.