Skip to content

Commit de84018

Browse files
authored
Migrate integrationtests Docker SDK path (#5273)
Use Moby API imports in integrationtests and update testcontainers-go to v0.42.0 for compatibility.
1 parent 18668f5 commit de84018

5 files changed

Lines changed: 55 additions & 57 deletions

File tree

integrationtests/cli/apply/helm_test.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import (
88
"os/exec"
99
"path/filepath"
1010

11-
"github.com/docker/go-connections/nat"
1211
. "github.com/onsi/ginkgo/v2"
1312
. "github.com/onsi/gomega"
1413
"github.com/rancher/fleet/integrationtests/cli"
@@ -92,7 +91,7 @@ var _ = Describe("Fleet apply helm release with HTTP OCI registry", Ordered, fun
9291
var (
9392
container testcontainers.Container
9493
host string
95-
port nat.Port
94+
port string
9695
tmpDir string
9796
relTmpDir string
9897
)
@@ -106,18 +105,19 @@ var _ = Describe("Fleet apply helm release with HTTP OCI registry", Ordered, fun
106105
host, err = container.Host(context.Background())
107106
Expect(err).ToNot(HaveOccurred())
108107

109-
port, err = container.MappedPort(context.Background(), nat.Port("5000"))
108+
mappedPort, err := container.MappedPort(context.Background(), "5000")
110109
Expect(err).ToNot(HaveOccurred())
110+
port = mappedPort.Port()
111111

112112
cmd := exec.Command("helm", "package", cli.AssetsPath+"config-chart/")
113113
out, err := cmd.CombinedOutput()
114114
Expect(err).ToNot(HaveOccurred(), out)
115115

116-
cmd = exec.Command("helm", "push", "config-chart-0.1.0.tgz", fmt.Sprintf("oci://%s:%d", host, port.Int()), "--plain-http")
116+
cmd = exec.Command("helm", "push", "config-chart-0.1.0.tgz", fmt.Sprintf("oci://%s:%s", host, port), "--plain-http")
117117
out, err = cmd.CombinedOutput()
118118
Expect(err).ToNot(HaveOccurred(), out)
119119

120-
err = createGitRepoDataForTest(tmpDir, host, port.Port(), "config-chart")
120+
err = createGitRepoDataForTest(tmpDir, host, port, "config-chart")
121121
Expect(err).ToNot(HaveOccurred())
122122

123123
pwd, err := os.Getwd()

integrationtests/gitcloner/clone_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import (
1616

1717
"github.com/rancher/fleet/internal/cmd/cli/gitcloner"
1818

19-
dockercontainer "github.com/docker/docker/api/types/container"
20-
dockermount "github.com/docker/docker/api/types/mount"
19+
dockercontainer "github.com/moby/moby/api/types/container"
20+
dockermount "github.com/moby/moby/api/types/mount"
2121
"github.com/go-git/go-git/v5"
2222
"github.com/go-git/go-git/v5/config"
2323
"github.com/go-git/go-git/v5/plumbing/object"

integrationtests/gitjob/git/git_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ import (
1515
"testing"
1616
"time"
1717

18-
dockercontainer "github.com/docker/docker/api/types/container"
19-
dockermount "github.com/docker/docker/api/types/mount"
18+
dockercontainer "github.com/moby/moby/api/types/container"
19+
dockermount "github.com/moby/moby/api/types/mount"
2020
gogit "github.com/go-git/go-git/v5"
2121
gitconfig "github.com/go-git/go-git/v5/config"
2222
"github.com/go-git/go-git/v5/plumbing/object"

integrationtests/go.mod

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,10 @@ replace (
3939
)
4040

4141
require (
42-
github.com/docker/docker v28.5.1+incompatible
43-
github.com/docker/go-connections v0.6.0
4442
github.com/go-git/go-git/v5 v5.19.1
4543
github.com/go-logr/logr v1.4.3
4644
github.com/gogits/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
45+
github.com/moby/moby/api v1.54.1
4746
github.com/onsi/ginkgo/v2 v2.27.1
4847
github.com/onsi/gomega v1.38.2
4948
github.com/otiai10/copy v1.14.1
@@ -52,7 +51,7 @@ require (
5251
github.com/rancher/wrangler/v3 v3.3.1
5352
github.com/reugn/go-quartz v0.15.2
5453
github.com/stretchr/testify v1.11.1
55-
github.com/testcontainers/testcontainers-go v0.38.0
54+
github.com/testcontainers/testcontainers-go v0.42.0
5655
go.uber.org/mock v0.6.0
5756
golang.org/x/crypto v0.50.0
5857
k8s.io/api v0.34.8
@@ -65,7 +64,7 @@ require (
6564
)
6665

6766
require (
68-
dario.cat/mergo v1.0.1 // indirect
67+
dario.cat/mergo v1.0.2 // indirect
6968
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
7069
github.com/BurntSushi/toml v1.5.0 // indirect
7170
github.com/MakeNowJust/heredoc v1.0.0 // indirect
@@ -97,8 +96,9 @@ require (
9796
github.com/docker/cli v29.2.0+incompatible // indirect
9897
github.com/docker/distribution v2.8.3+incompatible // indirect
9998
github.com/docker/docker-credential-helpers v0.9.3 // indirect
99+
github.com/docker/go-connections v0.6.0 // indirect
100100
github.com/docker/go-units v0.5.0 // indirect
101-
github.com/ebitengine/purego v0.8.4 // indirect
101+
github.com/ebitengine/purego v0.10.0 // indirect
102102
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
103103
github.com/emirpasic/gods v1.18.1 // indirect
104104
github.com/evanphx/json-patch v5.9.11+incompatible // indirect
@@ -151,7 +151,7 @@ require (
151151
github.com/jpillora/backoff v1.0.0 // indirect
152152
github.com/json-iterator/go v1.1.12 // indirect
153153
github.com/kevinburke/ssh_config v1.2.0 // indirect
154-
github.com/klauspost/compress v1.18.0 // indirect
154+
github.com/klauspost/compress v1.18.5 // indirect
155155
github.com/klauspost/cpuid/v2 v2.3.0 // indirect
156156
github.com/lann/builder v0.0.0-20180802200727-47ae307949d0 // indirect
157157
github.com/lann/ps v0.0.0-20150810152359-62de8c46ede0 // indirect
@@ -169,8 +169,9 @@ require (
169169
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
170170
github.com/mitchellh/reflectwalk v1.0.2 // indirect
171171
github.com/moby/docker-image-spec v1.3.1 // indirect
172-
github.com/moby/go-archive v0.1.0 // indirect
173-
github.com/moby/patternmatcher v0.6.0 // indirect
172+
github.com/moby/go-archive v0.2.0 // indirect
173+
github.com/moby/moby/client v0.4.0 // indirect
174+
github.com/moby/patternmatcher v0.6.1 // indirect
174175
github.com/moby/spdystream v0.5.1 // indirect
175176
github.com/moby/sys/sequential v0.6.0 // indirect
176177
github.com/moby/sys/user v0.4.0 // indirect
@@ -179,7 +180,6 @@ require (
179180
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
180181
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
181182
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
182-
github.com/morikuni/aec v1.0.0 // indirect
183183
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
184184
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
185185
github.com/opencontainers/go-digest v1.0.0 // indirect
@@ -189,7 +189,7 @@ require (
189189
github.com/pjbgf/sha1cd v0.6.0 // indirect
190190
github.com/pkg/errors v0.9.1 // indirect
191191
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
192-
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
192+
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
193193
github.com/prometheus/client_golang v1.23.0 // indirect
194194
github.com/prometheus/client_model v0.6.2 // indirect
195195
github.com/prometheus/common v0.67.1 // indirect
@@ -200,15 +200,15 @@ require (
200200
github.com/russross/blackfriday/v2 v2.1.0 // indirect
201201
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
202202
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
203-
github.com/shirou/gopsutil/v4 v4.25.5 // indirect
203+
github.com/shirou/gopsutil/v4 v4.26.3 // indirect
204204
github.com/shopspring/decimal v1.4.0 // indirect
205-
github.com/sirupsen/logrus v1.9.3 // indirect
205+
github.com/sirupsen/logrus v1.9.4 // indirect
206206
github.com/skeema/knownhosts v1.3.1 // indirect
207207
github.com/spf13/cast v1.7.0 // indirect
208208
github.com/spf13/cobra v1.10.1 // indirect
209209
github.com/spf13/pflag v1.0.10 // indirect
210-
github.com/tklauser/go-sysconf v0.3.12 // indirect
211-
github.com/tklauser/numcpus v0.6.1 // indirect
210+
github.com/tklauser/go-sysconf v0.3.16 // indirect
211+
github.com/tklauser/numcpus v0.11.0 // indirect
212212
github.com/ulikunitz/xz v0.5.15 // indirect
213213
github.com/vbatts/tar-split v0.12.1 // indirect
214214
github.com/x448/float16 v0.8.4 // indirect

0 commit comments

Comments
 (0)