Skip to content

Commit

Permalink
Temporary testnetwork setup
Browse files Browse the repository at this point in the history
  • Loading branch information
onee-only committed Jul 16, 2024
1 parent 8b31279 commit 42edeb1
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions internal/exec/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/api/types/filters"
"github.com/docker/docker/api/types/image"
"github.com/docker/docker/api/types/network"
"github.com/docker/go-connections/nat"
"github.com/google/uuid"
"github.com/influxdata/influxdb-client-go/api/write"
Expand Down Expand Up @@ -73,7 +72,7 @@ func (e *Executor) setupResources(
}

hostConf := &container.HostConfig{
NetworkMode: container.NetworkMode(e.ExecNetwork),
NetworkMode: container.NetworkMode(e.TestNetwork),
Resources: container.Resources{
Memory: int64(resource.Memory),
CPUPeriod: defaultCPUPeriod,
Expand Down Expand Up @@ -109,11 +108,11 @@ func (e *Executor) setupResources(
// primary process should be connected to the test network.
e.Log.Info("resource is primary. connecting to test network")

if err := e.Docker.NetworkConnect(ctx, e.TestNetwork, con.ID, &network.EndpointSettings{
DNSNames: []string{resource.Name},
}); err != nil {
return errors.Wrap(err, "connecting primary process to test network")
}
// if err := e.Docker.NetworkConnect(ctx, e.TestNetwork, con.ID, &network.EndpointSettings{
// DNSNames: []string{resource.Name},
// }); err != nil {
// return errors.Wrap(err, "connecting primary process to test network")
// }
}

if err := e.Docker.ContainerStart(ctx, con.ID, container.StartOptions{}); err != nil {
Expand Down

0 comments on commit 42edeb1

Please sign in to comment.