Skip to content

DNS resolution fails ("no such host") during go test with mirrord's GoLand plugin #3934

@buraksekili

Description

@buraksekili

Bug Description

Hey team, I have Go-based applications and e2e suites, and encountering an issue where DNS resolution for in-cluster k8s services works perfectly when running my application normally, but fails during test execution.

When I run the application to reach a k8s service using its in-cluster DNS record (like <svc_name>.<ns>.svc.cluster.local), it works as expected. However, when running tests via go test, I receive no such host errors, in GoLand plugin. I am able to make the test work if i run mirrord exec -f ".mirrord/mirrord.json" -- go test ./some/files/... However, if i try to debug the tests with GoLand plugin - it fails to reach the host.

I would like to clarify if this is a known limitation of how mirrord interacts with the Go test runner, or if there is a configuration adjustment needed to support this use case.

My mirrord.json looks as follows:

{
  "target": "targetless",
  "feature": {
    "network": {
      "dns": true,
      "outgoing": {
        "tcp": true,
        "udp": true
      }
    },
    "fs": "localwithoverrides",
    "env": {
      "exclude": "KUBERNETES_PORT;KUBERNETES_PORT_*;KUBERNETES_PORT_*_*;KUBERNETES_SERVICE_HOST;KUBERNETES_SERVICE_PORT;KUBERNETES_SERVICE_PORT_*"
    }
  }
}

Steps to Reproduce

  1. Copy the mirrord.json file
  2. Spin up kind cluster
  3. deploy sample apps (like nginx)
  4. Write a simple Go test to see if the nginx is reachable by its DNS record (nginx.nginx-ns.svc) while debugging tests in GoLand

Backtrace

mirrord layer logs

mirrord intproxy logs

mirrord agent logs

mirrord config

mirrord CLI version

No response

mirrord-agent version

No response

mirrord-operator version (if relevant)

No response

plugin kind and version (if relevant)

No response

Your operating system and version

macOS 15.6

Local process

go test

Local process version

No response

Additional Info

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions