Skip to content

Fix(connectors): resolve Docker host from active context - #550

Open
SafeeImran wants to merge 1 commit into
microcks:masterfrom
SafeeImran:fix/docker-context-host
Open

SafeeImran wants to merge 1 commit into
microcks:masterfrom
SafeeImran:fix/docker-context-host

Conversation

@SafeeImran

Copy link
Copy Markdown

What

Resolve the active Docker CLI context when DOCKER_HOST is unset.

This provides an interim approach for the Docker Desktop context
problem while retaining the existing Docker client integration.

Changes

  • Resolve the active Docker context using docker context inspect
  • Preserve an explicitly configured DOCKER_HOST
  • Add tests for context resolution and error handling
  • Verify the existing Docker client can connect through the resolved endpoint

Validation

  • go test ./pkg/connectors/... -count=1 passes
  • go vet ./pkg/connectors/... passes
  • git diff --check passes

Refs #539

@github-actions

Copy link
Copy Markdown

👋 @SafeeImran

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!

Resolve the active Docker CLI context when DOCKER_HOST is unset, allowing the existing Docker client to connect to Docker Desktop without migrating to docker/go-sdk.

Add connector tests covering context resolution, existing DOCKER_HOST preservation, command failures, and an actual Docker client ping.

Refs: microcks#539
Signed-off-by: Safee Imran <safiimran205@gmail.com>
@SafeeImran
SafeeImran force-pushed the fix/docker-context-host branch from 800c35b to 3297425 Compare September 28, 2026 05:43
@SafeeImran

Copy link
Copy Markdown
Author

@Harsh4902 please have a look

Comment on lines +80 to +83
if err := ConfigureDockerHost(); err != nil {
return nil, err
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@SafeeImran Bro this solution is already implemented in #538 by @ish-g09. I intentionally put that on halt as we want to discover that wether this is possible or not without making any manual effort. So I cant approve these changes.

@Harsh4902

Copy link
Copy Markdown
Member

#539 was completely about experimenting the new docker go-sdk and check wether it's stable for use or not even if it's no at 1.0.0 version.

@SafeeImran

Copy link
Copy Markdown
Author

@Harsh4902
Thanks, that clarifies it. I misunderstood #539 initially and approached it as a production migration rather than an evaluation/PoC. I also just discovered the #538 issue, which explains why my changes overlap with the earlier work.

I'll rework my branch around the actual goal of #539. I'll make sure the evaluation is focused on the experiment and is independent of the earlier production changes.

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.

2 participants