lostluck commented on code in PR #35964:
URL: https://github.com/apache/beam/pull/35964#discussion_r2304106272
##########
sdks/go/pkg/beam/runners/prism/internal/worker/worker.go:
##########
@@ -79,8 +82,32 @@ type controlResponder interface {
Respond(*fnpb.InstructionResponse)
}
+// resolveEndpoint checks if the worker is running inside a docker container
on mac or Windows and
+// if the endpoint is a "localhost" endpoint. If so, overrides it with
"host.docker.internal".
+// Reference:
https://docs.docker.com/desktop/features/networking/#networking-mode-and-dns-behaviour-for-mac-and-windows
+func (wk *W) resolveEndpoint(endpoint string) string {
+ // The presence of an external environment does not guarantee execution
within
+ // Docker, as Python's LOOPBACK also runs in an external environment.
+ // A specific check for the "BEAM_WORKER_POOL_IN_DOCKER_VM" environment
variable is required to confirm
+ // if the worker is running inside a Docker container.
Review Comment:
Aha! The goal here is to avoid Docker In Docker issues, where the address
may be weird because we're in a docker container at all. Makes sense.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]