diff --git a/go.mod b/go.mod index 71bf1bda..c832a53f 100644 --- a/go.mod +++ b/go.mod @@ -1,8 +1,15 @@ module github.com/spirit-labs/tektite -go 1.21 +go 1.22 -toolchain go1.22.3 +toolchain go1.22.4 + +//ToDo: remove this when we get a new release > v0.33.0 in testcontainers-go +replace ( + github.com/testcontainers/testcontainers-go => github.com/testcontainers/testcontainers-go v0.33.1-0.20240920111606-b823aad932f7 + github.com/testcontainers/testcontainers-go/modules/kafka => github.com/testcontainers/testcontainers-go/modules/kafka v0.33.1-0.20240920111606-b823aad932f7 + github.com/testcontainers/testcontainers-go/modules/minio => github.com/testcontainers/testcontainers-go/modules/minio v0.33.1-0.20240920111606-b823aad932f7 +) require ( github.com/alecthomas/kong v0.2.17 diff --git a/go.sum b/go.sum index 87cb1b7d..71da7669 100644 --- a/go.sum +++ b/go.sum @@ -932,14 +932,14 @@ github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXl github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg= github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY= github.com/syndtr/goleveldb v1.0.0/go.mod h1:ZVVdQEZoIme9iO1Ch2Jdy24qqXrMMOU6lpPAyBWyWuQ= -github.com/testcontainers/testcontainers-go v0.33.0 h1:zJS9PfXYT5O0ZFXM2xxXfk4J5UMw/kRiISng037Gxdw= -github.com/testcontainers/testcontainers-go v0.33.0/go.mod h1:W80YpTa8D5C3Yy16icheD01UTDu+LmXIA2Keo+jWtT8= +github.com/testcontainers/testcontainers-go v0.33.1-0.20240920111606-b823aad932f7 h1:sTy9AHLkPU75JB3iAnub4a4g1m6b6EJhYeXiefGszJs= +github.com/testcontainers/testcontainers-go v0.33.1-0.20240920111606-b823aad932f7/go.mod h1:rM5A56wRZcJhnk0CRNYGU4CQYjECaGXbTzHB2/R8p2s= github.com/testcontainers/testcontainers-go/modules/compose v0.31.0 h1:H74o3HisnApIDQx7sWibGzOl/Oo0By8DjyVeUf3qd6I= github.com/testcontainers/testcontainers-go/modules/compose v0.31.0/go.mod h1:z1JAsvL2/pNFy40yJX0VX9Yk+hzOCIO5DydxBJHBbCY= -github.com/testcontainers/testcontainers-go/modules/kafka v0.31.0 h1:8B1u+sDwYhTUoMI271wPjnCg9mz3dHGLMWpP7YyF7kE= -github.com/testcontainers/testcontainers-go/modules/kafka v0.31.0/go.mod h1:W1+yLUfUl8VLTzvmApP2FBHgCk8I5SKKjDWjxWEc33U= -github.com/testcontainers/testcontainers-go/modules/minio v0.33.0 h1:lHhjYlm0Oh+PfM03NIwCqNg2zSz9VuNTwUKi4MQfYAA= -github.com/testcontainers/testcontainers-go/modules/minio v0.33.0/go.mod h1:3WRFF6lLI3IqXb7lvOx6OpEcH1jgs59mbzZiPTJeEJg= +github.com/testcontainers/testcontainers-go/modules/kafka v0.33.1-0.20240920111606-b823aad932f7 h1:DiYAya7KBT7ZZA3ii5K/3jOmp1w2hsunuenGSofCmwY= +github.com/testcontainers/testcontainers-go/modules/kafka v0.33.1-0.20240920111606-b823aad932f7/go.mod h1:VWhufxbq7OH4Fla2ZhHo3q/daZWzGmqHr+KQLNeEzGY= +github.com/testcontainers/testcontainers-go/modules/minio v0.33.1-0.20240920111606-b823aad932f7 h1:BKBcT9/xqtpfrwVuMGia9eb1xZMQfiqSdrPW/dglgOU= +github.com/testcontainers/testcontainers-go/modules/minio v0.33.1-0.20240920111606-b823aad932f7/go.mod h1:5Oi38nmS66O2MOcFZuCEHG8jYQc2/sJ9PzDfe8gfbq4= github.com/tetratelabs/wazero v1.7.1 h1:QtSfd6KLc41DIMpDYlJdoMc6k7QTN246DM2+n2Y/Dx8= github.com/tetratelabs/wazero v1.7.1/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y= github.com/theupdateframework/notary v0.7.0 h1:QyagRZ7wlSpjT5N2qQAh/pN+DVqgekv4DzbAiAiEL3c= diff --git a/objstore/minio/client_test.go b/objstore/minio/client_test.go index 7706788d..3a7d975f 100644 --- a/objstore/minio/client_test.go +++ b/objstore/minio/client_test.go @@ -3,18 +3,23 @@ package minio import ( "context" "fmt" + "os" + "testing" + miniolib "github.com/minio/minio-go/v7" "github.com/spirit-labs/tektite/asl/conf" "github.com/spirit-labs/tektite/objstore" "github.com/stretchr/testify/require" "github.com/testcontainers/testcontainers-go/modules/minio" - "testing" ) func TestMinioObjStore(t *testing.T) { - + // Currently, Podman doesn't support Ryuk + // Raised an issue on testcontainers-go + // https://github.com/testcontainers/testcontainers-go/issues/2781 + // ToDo: Remove the below line once the above issue is resolved + os.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true") ctx := context.Background() - minioContainer, err := minio.Run(ctx, "minio/minio:RELEASE.2024-08-26T15-33-07Z", minio.WithUsername("minioadmin"), minio.WithPassword("minioadmin")) require.NoError(t, err) diff --git a/testutils/etcd.go b/testutils/etcd.go index 19aeb96e..946f7364 100644 --- a/testutils/etcd.go +++ b/testutils/etcd.go @@ -3,10 +3,12 @@ package testutils import ( "context" "fmt" + "os" + "sync" + "github.com/docker/go-connections/nat" "github.com/testcontainers/testcontainers-go" "github.com/testcontainers/testcontainers-go/wait" - "sync" ) type EtcdHolder struct { @@ -22,7 +24,7 @@ func (e *EtcdHolder) Stop() { if !e.started { return } - if err := e.container.Stop(context.Background(), nil); err != nil { + if err := e.container.Terminate(context.Background()); err != nil { panic(err) } e.started = false @@ -33,6 +35,11 @@ func (e *EtcdHolder) Address() string { } func CreateEtcdContainer() (*EtcdHolder, error) { + // Currently, Podman doesn't support Ryuk + // Raised an issue on testcontainers-go + // https://github.com/testcontainers/testcontainers-go/issues/2781 + // ToDo: Remove the below line once the above issue is resolved + os.Setenv("TESTCONTAINERS_RYUK_DISABLED", "true") ctx := context.Background() req := testcontainers.ContainerRequest{ Image: "gcr.io/etcd-development/etcd:v3.5.10",