Skip to content

Commit 7d24923

Browse files
author
Keerthan Reddy Mala
committed
fix(restart): wait for the pods to be scheduled
1 parent 0fa78f0 commit 7d24923

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

rootfs/api/models/app.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,11 @@ def restart(self, **kwargs): # noqa
269269
del kwargs['name']
270270
pods = self.list_pods(**kwargs)
271271
# Add in the latest name
272+
if len(pods) == 0:
273+
# if pod is not even scheduled wait for it and pass dummy kwargs
274+
# to indicate restart of a single pod
275+
kwargs['name'] = "dummy"
276+
continue
272277
kwargs['name'] = pods[0]['name']
273278
pods = pods[0]
274279

0 commit comments

Comments
 (0)