Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
  • Loading branch information
jhutar committed Oct 11, 2024
1 parent 49202b4 commit 9d8bbf4
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion ci-scripts/rhdh-setup/create_resource.sh
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,16 @@ get_token() {
#shellcheck disable=SC2064
trap "rm -rf $token_lockfile; exit" INT TERM EXIT HUP

echo "BEFORE"; cat "$token_field"

timeout_timestamp=$(date -d "$token_timeout seconds" "+%s")
while [ ! -f "$token_file" ] || [ ! -s "$token_file" ] || [ -z "$(jq -rc '.expires_in_timestamp' "$token_file")" ] || [ "$(date +%s)" -gt "$(jq -rc '.expires_in_timestamp' "$token_file")" ] || [ "$(jq -rc "$token_field" "$token_file")" == "null" ]; do
while \
[ ! -f "$token_file" ] \
|| [ ! -s "$token_file" ] \
|| [ -z "$(jq -rc '.expires_in_timestamp' "$token_file")" ] \
|| [ "$(date +%s)" -gt "$(jq -rc '.expires_in_timestamp' "$token_file")" ] \
|| [ "$(jq -rc "$token_field" "$token_file")" == "null" ]; \
do
if [ "$(date "+%s")" -gt "$timeout_timestamp" ]; then
log_token_err "Timeout getting $token_type token"
exit 1
Expand All @@ -372,6 +380,8 @@ get_token() {
sleep 5s
done

echo "AFTER"; cat "$token_field"

jq -rc "$token_field" "$token_file"
rm -rf "$token_lockfile"
}
Expand Down

0 comments on commit 9d8bbf4

Please sign in to comment.