Skip to content

Commit 78a688d

Browse files
authored
Merge pull request #860 from kmala/scale
fix(restart): wait for the pods to be scheduled
2 parents 0fa78f0 + 7d24923 commit 78a688d

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)