Commit 13188307 authored by André Anjos's avatar André Anjos 💬

Merge branch '77_add_logging_to_label_based_discover' into 'master'

Add logging information to lable based discover

See merge request !107
parents df54e749 570f19a8
Pipeline #36481 passed with stages
in 19 minutes
......@@ -401,13 +401,17 @@ class Host(object):
image_info = _parse_image_info(image)
key = "{} {}".format(image_info["name"], image_info["version"])
image_name = image_info["image"]
if key in environments:
if _must_replace(key, image, environments):
environments[key] = image_info
logger.info("Updated '%s' -> '%s'", key, image_name)
else:
environments[key] = image_info
Host.images_cache[image_info["image"]] = environments[key]
Host.images_cache[image_name] = environments[key]
logger.info("Registered '%s' -> '%s'", key, image_name)
return environments
client = docker.from_env()
......@@ -418,6 +422,12 @@ class Host(object):
executors = client.images.list(filters={"label": ["beat.env.type=execution"]})
environments = _process_image_list(executors)
logger.debug(
"Found %d environments and %d database environments",
len(environments),
len(db_environments),
)
return environments, db_environments
def create_container(self, image, command):
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment