Skip to content

Commit

Permalink
Use python+pyyaml instead of yq in deploy.sh (#59)
Browse files Browse the repository at this point in the history
Signed-off-by: Dean Roehrich <[email protected]>
  • Loading branch information
roehrich-hpe authored Mar 8, 2024
1 parent 790f69a commit 0b3a5de
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ if [[ $CMD == 'undeploy' ]]; then
$KUSTOMIZE build config/prometheus | kubectl delete --ignore-not-found -f-
fi
# Do not touch the namespace resource when deleting this service.
$KUSTOMIZE build "$OVERLAY_DIR" | yq eval 'select(.kind != "Namespace")' | kubectl delete --ignore-not-found -f -
# Wishing for yq(1)...
$KUSTOMIZE build "$OVERLAY_DIR" | python3 -c 'import yaml, sys; all_docs = yaml.safe_load_all(sys.stdin); less_docs=[doc for doc in all_docs if doc["kind"] != "Namespace"]; print(yaml.dump_all(less_docs))' | kubectl delete --ignore-not-found -f -
fi

exit 0

0 comments on commit 0b3a5de

Please sign in to comment.