@@ -505,12 +505,12 @@ async def restart_cluster(
505
505
if next_pod_uid in all_pod_uids :
506
506
# The next to-be-terminated pod still appears to be running.
507
507
logger .info ("Terminating pod '%s'" , next_pod_name )
508
+ node_index = int (next_pod_name [next_pod_name .rindex ("-" ) + 1 :])
509
+ node_progress = f"{ node_index + 1 } /{ len (all_pod_uids )} "
508
510
await send_operation_progress_notification (
509
511
namespace = namespace ,
510
512
name = name ,
511
- message = "Waiting for node "
512
- f"{ int (next_pod_name [next_pod_name .rindex ('-' )+ 1 :])+ 1 } /{ len (all_pod_uids )} "
513
- " to be terminated..." ,
513
+ message = f"Waiting for node { node_progress } to be terminated." ,
514
514
logger = logger ,
515
515
status = WebhookStatus .IN_PROGRESS ,
516
516
operation = WebhookOperation .UPDATE ,
@@ -527,12 +527,12 @@ async def restart_cluster(
527
527
elif next_pod_name in all_pod_names :
528
528
total_nodes = get_total_nodes_count (old ["spec" ]["nodes" ], "all" )
529
529
# The new pod has been spawned. Only a matter of time until it's ready.
530
+ node_index = int (next_pod_name [next_pod_name .rindex ("-" ) + 1 :])
531
+ node_progress = f"{ node_index + 1 } /{ len (all_pod_uids )} "
530
532
await send_operation_progress_notification (
531
533
namespace = namespace ,
532
534
name = name ,
533
- message = "Waiting for node "
534
- f"{ int (next_pod_name [next_pod_name .rindex ('-' )+ 1 :])+ 1 } /{ len (all_pod_uids )} "
535
- " to be restarted..." ,
535
+ message = f"Waiting for node { node_progress } to be restarted." ,
536
536
logger = logger ,
537
537
status = WebhookStatus .IN_PROGRESS ,
538
538
operation = WebhookOperation .UPDATE ,
0 commit comments