Merge "Fix the apply issue after uploading an app twice"

This commit is contained in:
Zuul 2019-06-25 21:41:59 +00:00 committed by Gerrit Code Review
commit 59085bed17
1 changed files with 8 additions and 1 deletions

View File

@ -1865,6 +1865,7 @@ class DockerHelper(object):
def __init__(self, dbapi):
self._dbapi = dbapi
self._lock = threading.Lock()
self.k8s_registry = None
self.gcr_registry = None
self.quay_registry = None
@ -1967,7 +1968,13 @@ class DockerHelper(object):
try:
client = docker.from_env(timeout=INSTALLATION_TIMEOUT)
armada_svc = self._start_armada_service(client)
# It causes problem if multiple threads attempt to start the
# same container, so add lock to ensure only one thread can
# start the Armada container at a time
with self._lock:
armada_svc = self._start_armada_service(client)
if armada_svc:
if request == 'validate':
cmd = 'armada validate ' + manifest_file