Skip to content

Commit

Permalink
remove metadata only if the container is destroyed
Browse files Browse the repository at this point in the history
  • Loading branch information
SaitTalhaNisanci committed Feb 14, 2020
1 parent dd2ed59 commit 6514b45
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def connect_to_master():
# main logic loop for the manager
def docker_checker():
client = docker.DockerClient(base_url='unix:///var/run/docker.sock')
actions = {'health_status: healthy': add_worker, 'die': remove_worker}
actions = {'health_status: healthy': add_worker, 'destroy': remove_worker}

# creates the necessary connection to make the sql calls if the master is ready
conn = connect_to_master()
Expand All @@ -64,7 +64,7 @@ def docker_checker():
this_container = client.containers.get(my_hostname)
compose_project = this_container.labels['com.docker.compose.project']

# we only care about worker container health/die events from this cluster
# we only care about worker container health/destroy events from this cluster
print("found compose project: %s" % compose_project, file=stderr)
filters = {'event': list(actions),
'label': ["com.docker.compose.project=%s" % compose_project,
Expand Down

0 comments on commit 6514b45

Please sign in to comment.