Skip to content

Commit 70ff06b

Browse files
committed
chore: use tc module for the registry
1 parent 46d041c commit 70ff06b

File tree

4 files changed

+6
-4
lines changed

4 files changed

+6
-4
lines changed

cmd/cli/commands/integration_test.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import (
1919
"github.com/docker/model-runner/pkg/distribution/registry"
2020
"github.com/stretchr/testify/require"
2121
"github.com/testcontainers/testcontainers-go"
22+
tc "github.com/testcontainers/testcontainers-go/modules/registry"
2223
"github.com/testcontainers/testcontainers-go/network"
2324
"github.com/testcontainers/testcontainers-go/wait"
2425
)
@@ -132,10 +133,7 @@ func setupTestEnv(t *testing.T) *testEnv {
132133

133134
func ociRegistry(t *testing.T, ctx context.Context, net *testcontainers.DockerNetwork) string {
134135
t.Log("Starting OCI registry container...")
135-
ctr, err := testcontainers.Run(
136-
ctx, "registry:3",
137-
testcontainers.WithExposedPorts("5000/tcp"),
138-
testcontainers.WithWaitStrategy(wait.ForHTTP("/v2/").WithPort("5000/tcp").WithStartupTimeout(30*time.Second)),
136+
ctr, err := tc.Run(context.Background(), "registry:3",
139137
network.WithNetwork([]string{"registry.local"}, net),
140138
)
141139
require.NoError(t, err)

cmd/cli/go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ require (
2424
github.com/spf13/pflag v1.0.9
2525
github.com/stretchr/testify v1.11.1
2626
github.com/testcontainers/testcontainers-go v0.39.0
27+
github.com/testcontainers/testcontainers-go/modules/registry v0.39.0
2728
go.opentelemetry.io/otel v1.37.0
2829
go.uber.org/mock v0.5.0
2930
golang.org/x/sync v0.17.0

cmd/cli/go.sum

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,8 @@ github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu
334334
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
335335
github.com/testcontainers/testcontainers-go v0.39.0 h1:uCUJ5tA+fcxbFAB0uP3pIK3EJ2IjjDUHFSZ1H1UxAts=
336336
github.com/testcontainers/testcontainers-go v0.39.0/go.mod h1:qmHpkG7H5uPf/EvOORKvS6EuDkBUPE3zpVGaH9NL7f8=
337+
github.com/testcontainers/testcontainers-go/modules/registry v0.39.0 h1:Wq08A4G5o/OYb68xWVzVWSHrpckpYab4+5u+8T5UaYQ=
338+
github.com/testcontainers/testcontainers-go/modules/registry v0.39.0/go.mod h1:RIRXImSUJ5MYAiM8Hl39JdMD6pHsRsgfhgR+L22dhMk=
337339
github.com/theupdateframework/notary v0.7.1-0.20210315103452-bf96a202a09a h1:tlJ7tGUHvcvL1v3yR6NcCc9nOqh2L+CG6HWrYQtwzQ0=
338340
github.com/theupdateframework/notary v0.7.1-0.20210315103452-bf96a202a09a/go.mod h1:Y94A6rPp2OwNfP/7vmf8O2xx2IykP8pPXQ1DLouGnEw=
339341
github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFAEVmqU=

go.work.sum

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ github.com/coreos/go-systemd/v22 v22.5.0 h1:RrqgGjYQKalulkV8NGVIfkXQf6YYmOyiJKk8
133133
github.com/coreos/go-systemd/v22 v22.5.0/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSVTIJ3seZv2GcEnc=
134134
github.com/cpuguy83/go-md2man/v2 v2.0.3/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
135135
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
136+
github.com/creack/pty v1.1.18/go.mod h1:MOBLtS5ELjhRRrroQr9kyvTxUAFNvYEK993ew/Vr4O4=
136137
github.com/danieljoos/wincred v1.2.2 h1:774zMFJrqaeYCK2W57BgAem/MLi6mtSE47MB6BOJ0i0=
137138
github.com/danieljoos/wincred v1.2.2/go.mod h1:w7w4Utbrz8lqeMbDAK0lkNJUv5sAOkFi7nd/ogr0Uh8=
138139
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=

0 commit comments

Comments
 (0)