Skip to content

Commit

Permalink
Optimized bash scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
jamallorock committed Feb 7, 2025
1 parent 359090c commit b5cd997
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scripts/common_utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ check_running() {

# Use `kubectl wait` for more efficient waiting instead of polling
if ! ${kubectl_cmd} wait --for=condition=Ready pod -l "app=${check_pod}" --timeout=60s; then
echo "Error: ${check_pod} failed to become ready within timeout."
>&2 echo "Error: ${check_pod} failed to become ready within timeout."
return 1
fi

Expand All @@ -41,8 +41,8 @@ check_running() {
# Check error code from the last command, exit on failure
check_err() {
local err=$?
if [ ${err} -ne 0 ]; then
echo "Error: $*"
if [ "${err}" -ne 0 ]; then
>&2 echo "Error: $*"
exit 1 # Use standard Unix exit code
fi
}

0 comments on commit b5cd997

Please sign in to comment.