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

Commit 94a6872

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 79cd529 commit 94a6872

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
@@ -907,6 +907,10 @@ def _wait_until_pods_are_ready(self, namespace, container, labels, desired): #
907907
logger.info('timed out ({}s) waiting for pods to come up in namespace {}'.format(timeout, namespace)) # noqa
908908

909909
logger.info("{} out of {} pods in namespace {} are in service".format(count, desired, namespace)) # noqa
910+
if count != desired:
911+
# raising to allow operations to rollback
912+
raise KubeException('Not enough pods in namespace {} came into service. '
913+
'{} out of {}'.format(namespace, count, desired))
910914

911915
def _scale_rc(self, namespace, name, desired):
912916
rc = self.get_rc(namespace, name).json()

0 commit comments

Comments
 (0)