|
97 | 97 | } |
98 | 98 | }, |
99 | 99 | "spec": { |
100 | | - "replicas": $num, |
| 100 | + "replicas": $replicas, |
101 | 101 | "selector": { |
102 | 102 | "app": "$id", |
103 | 103 | "version": "$appversion", |
|
151 | 151 | } |
152 | 152 | }, |
153 | 153 | "spec": { |
154 | | - "replicas": $num, |
| 154 | + "replicas": $replicas, |
155 | 155 | "selector": { |
156 | 156 | "app": "$id", |
157 | 157 | "version": "$appversion", |
@@ -400,19 +400,19 @@ def deploy(self, namespace, name, image, command, **kwargs): |
400 | 400 |
|
401 | 401 | def scale(self, namespace, name, image, command, **kwargs): |
402 | 402 | logger.debug('scale {}, img {}, params {}, cmd "{}"'.format(name, image, kwargs, command)) |
403 | | - num = kwargs.pop('num') |
| 403 | + replicas = kwargs.pop('replicas') |
404 | 404 | if unhealthy(self._get_rc_status(namespace, name)): |
405 | 405 | # add RC if it is missing for the namespace |
406 | 406 | try: |
407 | 407 | # Create RC with scale as 0 and then scale to get pod monitoring |
408 | | - kwargs['num'] = 0 |
| 408 | + kwargs['replicas'] = 0 |
409 | 409 | self._create_rc(namespace, name, image, command, **kwargs) |
410 | 410 | except KubeException as e: |
411 | 411 | logger.debug("Creating RC failed because of: {}".format(str(e))) |
412 | 412 | raise RuntimeError('{} (RC): {}'.format(name, e)) |
413 | 413 |
|
414 | 414 | try: |
415 | | - self._scale_rc(namespace, name, num) |
| 415 | + self._scale_rc(namespace, name, replicas) |
416 | 416 | except KubeException as e: |
417 | 417 | logger.debug("Scaling failed because of: {}".format(str(e))) |
418 | 418 | old = self._get_rc(namespace, name).json() |
@@ -839,10 +839,10 @@ def _create_rc(self, namespace, name, image, command, **kwargs): # noqa |
839 | 839 | l = { |
840 | 840 | "name": name, |
841 | 841 | "id": namespace, |
842 | | - "appversion": kwargs.get("version", {}), |
| 842 | + "appversion": kwargs.get("version"), |
843 | 843 | "version": self.apiversion, |
844 | 844 | "image": imgurl, |
845 | | - "num": kwargs.get("num", {}), |
| 845 | + "replicas": kwargs.get("replicas", 0), |
846 | 846 | "containername": container_name, |
847 | 847 | "type": app_type, |
848 | 848 | } |
|
0 commit comments