Skip to content

fix: prevent context deletion from stranding local instances - #642

Open
Rama542 wants to merge 1 commit into
microcks:masterfrom
Rama542:fix/context-delete-running-instance
Open

Rama542 wants to merge 1 commit into
microcks:masterfrom
Rama542:fix/context-delete-running-instance

Conversation

@Rama542

@Rama542 Rama542 commented Nov 25, 2026 •

Copy link
Copy Markdown

Description

This PR fixes an issue where deleting the only context created by
microcks start removes the configuration file while the local
container is still running. This causes the stored container ID to
be lost, preventing microcks stop from stopping the running instance.

The following changes are included:

  • Prevent deletion of a context associated with a running local
    Microcks instance by returning a usage error and preserving
    the existing configuration.
  • Update LocalConfig.IsEmpty() to consider all configuration
    sections before removing the configuration file.
  • Remove stale authentication entries when the last server
    referencing them is deleted.
  • Add regression tests for context deletion and configuration handling.
  • Update the context command documentation.

Testing

The following commands were executed to validate the changes:

  • go fmt ./...
  • go test ./cmd -run "TestContext|TestDeleteContext"
  • go test ./pkg/config -run "TestLocalConfig"
  • go build -o build/dist/microcks

The full go test ./... run reports pre-existing Windows
path-related failures in unrelated packages.

AI Disclosure

AI assistance was used for analysis and implementation review.
I reviewed and tested the changes and take full responsibility
for this contribution.

@github-actions

Copy link
Copy Markdown

👋 @Rama542

Welcome to the Microcks community! 💖

Thanks and congrats 🎉 for opening your first pull request here! Be sure to follow the pull request template or please update it accordingly.

Hope you have a great time there!

Signed-off-by: Rama sasank gudipati <220448411+Rama542@users.noreply.github.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant