Skip to content
This repository was archived by the owner on May 6, 2020. It is now read-only.

Commit 1fd98af

Browse files
committed
fix(scheduler): rollback scale / deploy when the desired number of pods can not be brought up in a timely manner
Prior to this if a deploy failed at bringing up pods then it would still scale down the old release instead of rolling back. This would cause users to basically have a broken app if the new pods for whatever reason stick around in Pending mode Fixes #706
1 parent 2bb7724 commit 1fd98af

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

rootfs/scheduler/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -927,6 +927,10 @@ def _wait_until_pods_are_ready(self, namespace, containers, labels, desired): #
927927
logger.info('timed out ({}s) waiting for pods to come up in namespace {}'.format(timeout, namespace)) # noqa
928928

929929
logger.info("{} out of {} pods in namespace {} are in service".format(count, desired, namespace)) # noqa
930+
if count != desired:
931+
# raising to allow operations to rollback
932+
raise KubeException('Not enough pods in namespace {} came into service. '
933+
'{} out of {}'.format(namespace, count, desired))
930934

931935
def _scale_rc(self, namespace, name, desired):
932936
rc = self.get_rc(namespace, name).json()

0 commit comments

Comments
 (0)