Skip to content

Commit

Permalink
keep deprecated method for mount for TestContainers to avoid direct A…
Browse files Browse the repository at this point in the history
…PI dep. (#372)

Signed-off-by: Matteo Mortari <[email protected]>
  • Loading branch information
tarilabs authored Sep 11, 2024
1 parent eeb020e commit 031e963
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ require (
github.com/containerd/log v0.1.0 // indirect
github.com/cpuguy83/dockercfg v0.3.1 // indirect
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
github.com/docker/docker v27.2.1+incompatible
github.com/docker/docker v27.2.1+incompatible // indirect
github.com/docker/go-connections v0.5.0 // indirect
github.com/docker/go-units v0.5.0 // indirect
github.com/fsnotify/fsnotify v1.7.0 // indirect
Expand Down
10 changes: 7 additions & 3 deletions internal/testutils/test_container_utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import (
"strings"
"testing"

"github.com/docker/docker/api/types/container"
"github.com/kubeflow/model-registry/internal/ml_metadata/proto"
testcontainers "github.com/testcontainers/testcontainers-go"
"github.com/testcontainers/testcontainers-go/wait"
Expand Down Expand Up @@ -87,8 +86,13 @@ func SetupMLMetadataTestContainer(t *testing.T) (*grpc.ClientConn, proto.Metadat
Env: map[string]string{
"METADATA_STORE_SERVER_CONFIG_FILE": "/tmp/shared/conn_config.pb",
},
HostConfigModifier: func(hc *container.HostConfig) {
hc.Binds = []string{wd + ":/tmp/shared"}
Mounts: testcontainers.ContainerMounts{
testcontainers.ContainerMount{
Source: testcontainers.GenericBindMountSource{ // nolint keep deprecated method to avoid depending directly to docker api exposed by testcontainers' HostConfigModifier
HostPath: wd,
},
Target: "/tmp/shared",
},
},
WaitingFor: wait.ForLog("Server listening on"),
Privileged: true,
Expand Down

0 comments on commit 031e963

Please sign in to comment.