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

Commit c4813e3

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 43354be commit c4813e3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

rootfs/scheduler/__init__.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1005,7 +1005,11 @@ def _wait_until_pods_are_ready(self, namespace, containers, labels, desired, tim
10051005
if waited > timeout:
10061006
self.log(namespace, 'timed out ({}s) waiting for pods to come up in namespace {}'.format(timeout, namespace)) # noqa
10071007

1008-
self.log(namespace, "{} out of {} pods are in service".format(count, desired)) # noqa
1008+
self.log(namespace, "{} out of {} pods are in service".format(count, desired))
1009+
if count != desired:
1010+
# raising to allow operations to rollback
1011+
raise KubeException('Not enough pods in namespace {} came into service. '
1012+
'{} out of {}'.format(namespace, count, desired))
10091013

10101014
def _scale_rc(self, namespace, name, desired, timeout):
10111015
rc = self.get_rc(namespace, name).json()

0 commit comments

Comments
 (0)