Skip to content

Commit f86dadb

Browse files
Use COMPLEMENT_HOSTNAME_RUNNING_COMPLEMENT config for ExtraHosts in Docker (#825)
(doesn't fix anything specifically, just aligning to what we should be doing) It looks like this regressed in #389 (previously, we we're using `HostnameRunningComplement` here)
1 parent 98c05e6 commit f86dadb

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

internal/docker/builder.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ import (
3232
"github.com/matrix-org/complement/internal/instruction"
3333
)
3434

35-
var (
36-
// HostnameRunningDocker is the hostname of the docker daemon from the perspective of Complement.
37-
HostnameRunningDocker = "localhost"
38-
// HostnameRunningComplement is the hostname of Complement from the perspective of a Homeserver.
39-
HostnameRunningComplement = "host.docker.internal"
40-
)
41-
4235
const complementLabel = "complement_context"
4336

4437
type Builder struct {

internal/docker/deployer.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ func deployImage(
348348
// interact with a complement-controlled test server.
349349
// Note: this feature of docker landed in Docker 20.10,
350350
// see https://github.com/moby/moby/pull/40007
351-
extraHosts = []string{"host.docker.internal:host-gateway"}
351+
extraHosts = []string{fmt.Sprintf("%s:host-gateway", cfg.HostnameRunningComplement)}
352352
}
353353

354354
for _, m := range cfg.HostMounts {

0 commit comments

Comments
 (0)