Skip to content

Commit b8d36bc

Browse files
committed
Merge pull request #431 from helgi/fix_429
fix(scheduler): if a pod is in pending there is no start time, instead use now()
2 parents 0ff0d22 + 641f748 commit b8d36bc

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

rootfs/api/models/app.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from datetime import datetime
12
import logging
23
import re
34
import requests
@@ -538,7 +539,11 @@ def list_pods(self, *args, **kwargs):
538539
item['state'] = self._scheduler.resolve_state(p).name
539540
item['release'] = p['metadata']['labels']['version']
540541
item['type'] = p['metadata']['labels']['type']
541-
item['started'] = p['status']['startTime']
542+
if 'startTime' in p['status']:
543+
started = p['status']['startTime']
544+
else:
545+
started = str(datetime.utcnow().strftime(settings.DEIS_DATETIME_FORMAT))
546+
item['started'] = started
542547

543548
data.append(item)
544549

0 commit comments

Comments
 (0)