Skip to content

Deleting one context removes config when multiple contexts share a single server #421

@Syedowais312

Description

@Syedowais312

Describe the bug

Describe the bug

If the local config contains multiple contexts for the same Microcks server,
deleting one of those contexts can remove the shared server config for all of them.

To Reproduce

  1. Start Microcks locally:

    ./microcks start
    
  2. Create another context pointing to the same server:

    ./microcks login http://localhost:8585 --name dev

  3. Delete one of the contexts:

    ./microcks context dev --delete

  4. Inspect the local config:

    cat ~/.config/microcks/config

Current behavior

When there is only one server entry in the config and multiple contexts point to
that same server, deleting one context can also remove the shared server-related
metadata. In some cases, the whole config file is deleted(including the metada of the isntance).

Expected behavior

Expected behavior

Deleting one context should remove only that context. The shared server, user, auth,
and instance metadata should remain as long as another context still references the
same server.

Additional context

This was reproduced with multiple contexts pointing to http://localhost:8585.

Actual behavior

No response

How to Reproduce?

No response

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

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions