Skip to content

Commit

Permalink
Fix dependencies being restarted on dry-run or monitor-only
Browse files Browse the repository at this point in the history
  • Loading branch information
gmt2001 committed Dec 10, 2024
1 parent f4390e1 commit 20944b1
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions pyouroboros/dockerclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,8 @@ def update(self):
mylocals = {}
mylocals['container'] = container
run_hook('before_stop_depends_container', None, mylocals)
self.stop(container)
if not self.config.dry_run and not self.config.monitor_only:
self.stop(container)

for container, current_image, latest_image in updateable:
if self.config.dry_run:
Expand Down Expand Up @@ -400,15 +401,19 @@ def update(self):
mylocals = {}
mylocals['container'] = container
run_hook('before_start_depends_container', None, mylocals)
container.reload()
container.start()
if not self.config.dry_run and not self.config.monitor_only:
container.reload()
container.start()

for container in hard_depends_on_containers:
mylocals = {}
mylocals['old_container'] = container
run_hook('before_recreate_hard_depends_container', None, mylocals)
new_container = self.recreate(container, container.image)
mylocals['new_container'] = new_container
if not self.config.dry_run and not self.config.monitor_only:
new_container = self.recreate(container, container.image)
mylocals['new_container'] = new_container
else:
mylocals['new_container'] = container
run_hook('after_recreate_hard_depends_container', None, mylocals)

if updated_count > 0:
Expand Down

0 comments on commit 20944b1

Please sign in to comment.