Skip to content

Commit

Permalink
fix(controller): Set replicas to the current value of the deployment.
Browse files Browse the repository at this point in the history
  • Loading branch information
jfuechsl committed Jun 15, 2020
1 parent d6023de commit a4d0e22
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions rootfs/scheduler/resources/deployment.py
Expand Up @@ -137,6 +137,11 @@ def create(self, namespace, name, image, entrypoint, command, spec_annotations,
return response

def update(self, namespace, name, image, entrypoint, command, spec_annotations, **kwargs):
# Set the replicas value to the current replicas of the deployment.
# This avoids resetting the replicas which causes disruptions during the deployment.
deployment = self.deployment.get(namespace, name).json()
current_replicas = int(deployment['spec']['replicas'])
kwargs['replicas'] = current_replicas
manifest = self.manifest(namespace, name, image,
entrypoint, command, spec_annotations, **kwargs)

Expand Down

0 comments on commit a4d0e22

Please sign in to comment.