Skip to content

Commit

Permalink
Updater: switch from kubernetes apps beta api to stable
Browse files Browse the repository at this point in the history
  • Loading branch information
cccs-douglass committed Apr 8, 2020
1 parent 9821191 commit 28cfb5b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assemblyline_core/updater/run_updater.py
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ def __init__(self, prefix, namespace, priority_class):
config.load_kube_config(client_configuration=cfg)

self.prefix = prefix.lower()
self.b1api = client.AppsV1beta1Api()
self.apps_api = client.AppsV1Api()
self.api = client.CoreV1Api()
self.batch_api = client.BatchV1Api()
self.namespace = namespace
Expand Down Expand Up @@ -260,9 +260,9 @@ def launch(self, name, docker_config: DockerConfig, mounts, env, network, blocki

def restart(self, service_name):
name = (self.prefix + service_name.lower()).replace('_', '-')
scale = self.b1api.read_namespaced_deployment_scale(name=name, namespace=self.namespace)
scale = self.apps_api.read_namespaced_deployment_scale(name=name, namespace=self.namespace)
scale.spec.replicas = 0
self.b1api.replace_namespaced_deployment_scale(name=name, namespace=self.namespace, body=scale)
self.apps_api.replace_namespaced_deployment_scale(name=name, namespace=self.namespace, body=scale)


class ServiceUpdater(CoreBase):
Expand Down

0 comments on commit 28cfb5b

Please sign in to comment.