Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
beat
beat.core
Commits
570f19a8
Commit
570f19a8
authored
Jan 21, 2020
by
Samuel GAIST
Browse files
[dock] Add logging information to lable based discover
This will show information similar to the describe based implementation.
parent
df54e749
Pipeline
#36478
passed with stage
in 29 minutes and 21 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
beat/core/dock.py
View file @
570f19a8
...
...
@@ -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
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment