Skip to content

bug: stale instance entries accumulate in config when container is recreated #483

Description

@Syedowais312

Describe the bug

Description

When a container is removed externally (e.g. docker stop && docker rm) and
microcks start recreates it, the old instance entry is never removed from config.
A new entry is appended instead, causing duplicate instance records to accumulate.

Expected behavior

No response

Actual behavior

No response

How to Reproduce?

Steps to Reproduce

  1. ./microcks start
  2. docker stop microcks && docker rm microcks
  3. ./microcks start
  4. cat ~/.config/microcks/config two instance entries with same name but different container IDs

Screenshots

Image Image

Root Cause

RemoveInstance matched by Name instead of ContainerID. Since the recreated
container has a new ID, UpsertInstance never finds a match and always appends.

Microcks version or git rev

No response

Install method (docker-compose, helm chart, operator, docker-desktop extension,...)

No response

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    staleState due to inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions