Skip to content

HostManager leaves containers from old services #363

@BrianJKoopman

Description

@BrianJKoopman

Probably more of a feature request than a bug, but we should add the --remove-orphans flag to the HostManager's docker-compose command. This'll remove old containers automatically in the rare instances that a service is renamed.

I think this just needs to be added here:

def up(self):
self.d = _run_docker_compose(
['-f', self.service['compose_file'],
'up', '-d', self.service['service']],
docker_compose_bin=self.docker_compose_bin)
self.status = None, time.time()

For some context, we ran into this on site twice somewhat recently, once we were careful to bring down the service before deploying the new one and bringing the new agent up, the other we weren't as careful, and the old copy of the Agent prevented the new one from working properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent: hostmanagerbugSomething isn't workingenhancementNew feature or requestneeds triageCause of bug still unknown, needs investigation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions