Skip to content

Commit

Permalink
Merge pull request #293 from cschwede/verbose-ring-configmap-update-e…
Browse files Browse the repository at this point in the history
…rrors

Be more verbose on ring ConfigMap update errors
  • Loading branch information
openshift-merge-bot[bot] authored Nov 4, 2024
2 parents 8f5dd9c + ec0913e commit 6b7166f
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions templates/swiftring/bin/swift-ring-tool
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function get() {
-H "Authorization: Bearer $TOKEN" \
-o "${CM_NAME}.json" \
-w "%{http_code}" \
--silent --show-error --fail \
--silent --show-error --fail-with-body \
-X GET "${URL}")

case $HTTP_CODE in
Expand All @@ -37,6 +37,8 @@ function get() {
;;

*)
cat "${CM_NAME}.json"
rm "${CM_NAME}.json"
exit 1
;;
esac
Expand Down Expand Up @@ -141,12 +143,13 @@ function push() {
}'

# https://kubernetes.io/docs/reference/kubernetes-api/config-and-storage-resources/config-map-v1/#update-replace-the-specified-configmap
/usr/bin/curl \
RESPONSE_BODY=$(/usr/bin/curl \
-H "Authorization: Bearer $TOKEN" \
--data-binary "${CONFIGMAP_JSON}" \
-H 'Content-Type: application/json' \
-o /dev/null --silent --show-error --fail \
-X "${METHOD}" "${URL}"
--silent --show-error --fail-with-body \
-X "${METHOD}" "${URL}")
[ $? -ne 0 ] && echo -e "${RESPONSE_BODY}" || true
}


Expand Down

0 comments on commit 6b7166f

Please sign in to comment.