Skip to content

Commit 2c437ce

Browse files
committed
try no-ipv6 net
1 parent bff6592 commit 2c437ce

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

framework/config.go

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ import (
1111
"github.com/pelletier/go-toml/v2"
1212
"github.com/rs/zerolog"
1313
"github.com/stretchr/testify/require"
14-
"github.com/testcontainers/testcontainers-go"
15-
"github.com/testcontainers/testcontainers-go/network"
1614
"os"
1715
"path/filepath"
1816
"strings"
1917
"sync"
2018
"testing"
2119
"text/template"
2220
"time"
21+
22+
tc "github.com/testcontainers/testcontainers-go"
2323
)
2424

2525
const (
@@ -146,14 +146,22 @@ func Load[X any](t *testing.T) (*X, error) {
146146
}
147147

148148
func DefaultNetwork(once *sync.Once) error {
149-
var net *testcontainers.DockerNetwork
150149
var err error
150+
name := "ctf"
151151
once.Do(func() {
152-
net, err = network.New(
153-
context.Background(),
154-
network.WithLabels(map[string]string{"framework": "ctf"}),
155-
)
156-
DefaultNetworkName = net.Name
152+
f := false
153+
//nolint:staticcheck
154+
_, err := tc.GenericNetwork(context.Background(), tc.GenericNetworkRequest{
155+
//nolint:staticcheck
156+
NetworkRequest: tc.NetworkRequest{
157+
Name: name,
158+
EnableIPv6: &f,
159+
},
160+
})
161+
if err != nil {
162+
panic(fmt.Errorf("failed to create default network: %w", err))
163+
}
164+
DefaultNetworkName = name
157165
})
158166
return err
159167
}

0 commit comments

Comments
 (0)