Skip to content

Commit

Permalink
PR fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FedeAlonso committed Oct 20, 2023
1 parent 734a405 commit c3ad521
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions ods_ci/tasks/Resources/Provisioning/GPU/gpu_deploy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,15 @@ function rerun_accelerator_migration() {
local sleep_time=5

echo "Deleting configmap migration-gpu-status"
oc delete configmap migration-gpu-status -n redhat-ods-applications
if [[ $? -ne 0 ]]
if ! oc delete configmap migration-gpu-status -n redhat-ods-applications;
then
printf "ERROR: When trying to delete the migration-gpu-status configmap\n"
return 1
fi

dashboard_rs=$(oc get rs -n redhat-ods-applications | grep rhods-dashboard- | awk '{print $1;exit}')
echo "Deleting ReplicaSet $dashboard_rs"
oc delete rs $dashboard_rs -n redhat-ods-applications
if [[ $? -ne 0 ]]
if ! oc delete rs $dashboard_rs -n redhat-ods-applications;
then
printf "ERROR: When trying to delete the dashboard replica set\n"
return 1
Expand All @@ -71,8 +69,8 @@ function rerun_accelerator_migration() {
SECONDS=0
while [ "$SECONDS" -le "$timeout_seconds" ]; do
dashboard_pods=$(oc get deployment rhods-dashboard -n redhat-ods-applications | grep rhods-dashboard | awk '{print $2;exit}')
dashboard_pods_total=`echo $dashboard_pods | cut -c3-3`
dashboard_pods_avail=`echo $dashboard_pods | cut -c1-1`
dashboard_pods_total=$(echo $dashboard_pods | cut -c3-3)
dashboard_pods_avail=$(echo $dashboard_pods | cut -c1-1)
((remaining_seconds = timeout_seconds - SECONDS))
echo "Dashboard pods: Available $dashboard_pods_avail out of $dashboard_pods_total ... (timeout in $remaining_seconds seconds)"
if [ $dashboard_pods_avail == $dashboard_pods_total ]; then
Expand Down

0 comments on commit c3ad521

Please sign in to comment.