Skip to content

Commit 5317097

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

5 files changed

Lines changed: 54 additions & 56 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"
@@ -82,7 +81,7 @@ var _ = Describe("Fleet apply helm release with HTTP OCI registry", Ordered, fun
8281
var (
8382
container testcontainers.Container
8483
host string
85-
port nat.Port
84+
port string
8685
tmpDir string
8786
relTmpDir string
8887
)
@@ -96,18 +95,19 @@ var _ = Describe("Fleet apply helm release with HTTP OCI registry", Ordered, fun
9695
host, err = container.Host(context.Background())
9796
Expect(err).ToNot(HaveOccurred())
9897

99-
port, err = container.MappedPort(context.Background(), nat.Port("5000"))
98+
mappedPort, err := container.MappedPort(context.Background(), "5000")
10099
Expect(err).ToNot(HaveOccurred())
100+
port = mappedPort.Port()
101101

102102
cmd := exec.Command("helm", "package", cli.AssetsPath+"config-chart/")
103103
out, err := cmd.CombinedOutput()
104104
Expect(err).ToNot(HaveOccurred(), out)
105105

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

110-
err = createGitRepoDataForTest(tmpDir, host, port.Port(), "config-chart")
110+
err = createGitRepoDataForTest(tmpDir, host, port, "config-chart")
111111
Expect(err).ToNot(HaveOccurred())
112112

113113
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: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,10 @@ replace (
1010
)
1111

1212
require (
13-
github.com/docker/docker v28.5.2+incompatible
14-
github.com/docker/go-connections v0.5.0
1513
github.com/go-git/go-git/v5 v5.19.1
1614
github.com/go-logr/logr v1.4.3
1715
github.com/gogits/go-gogs-client v0.0.0-20210131175652-1d7215cd8d85
16+
github.com/moby/moby/api v1.54.1
1817
github.com/onsi/ginkgo/v2 v2.23.4
1918
github.com/onsi/gomega v1.37.0
2019
github.com/otiai10/copy v1.14.1
@@ -23,7 +22,7 @@ require (
2322
github.com/rancher/wrangler/v3 v3.2.2
2423
github.com/reugn/go-quartz v0.14.0
2524
github.com/stretchr/testify v1.11.1
26-
github.com/testcontainers/testcontainers-go v0.37.0
25+
github.com/testcontainers/testcontainers-go v0.42.0
2726
go.uber.org/mock v0.5.2
2827
golang.org/x/crypto v0.50.0
2928
k8s.io/api v0.33.12
@@ -43,7 +42,7 @@ require (
4342
cloud.google.com/go/iam v1.5.3 // indirect
4443
cloud.google.com/go/monitoring v1.24.3 // indirect
4544
cloud.google.com/go/storage v1.61.3 // indirect
46-
dario.cat/mergo v1.0.1 // indirect
45+
dario.cat/mergo v1.0.2 // indirect
4746
github.com/Azure/go-ansiterm v0.0.0-20250102033503-faa5f7b0171c // indirect
4847
github.com/BurntSushi/toml v1.5.0 // indirect
4948
github.com/GoogleCloudPlatform/opentelemetry-operations-go/detectors/gcp v1.30.0 // indirect
@@ -98,8 +97,9 @@ require (
9897
github.com/docker/cli v29.2.0+incompatible // indirect
9998
github.com/docker/distribution v2.8.3+incompatible // indirect
10099
github.com/docker/docker-credential-helpers v0.9.3 // indirect
100+
github.com/docker/go-connections v0.6.0 // indirect
101101
github.com/docker/go-units v0.5.0 // indirect
102-
github.com/ebitengine/purego v0.8.2 // indirect
102+
github.com/ebitengine/purego v0.10.0 // indirect
103103
github.com/emicklei/go-restful/v3 v3.12.1 // indirect
104104
github.com/emirpasic/gods v1.18.1 // indirect
105105
github.com/envoyproxy/go-control-plane/envoy v1.36.0 // indirect
@@ -170,8 +170,9 @@ require (
170170
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
171171
github.com/mitchellh/reflectwalk v1.0.2 // indirect
172172
github.com/moby/docker-image-spec v1.3.1 // indirect
173-
github.com/moby/go-archive v0.1.0 // indirect
174-
github.com/moby/patternmatcher v0.6.0 // indirect
173+
github.com/moby/go-archive v0.2.0 // indirect
174+
github.com/moby/moby/client v0.4.0 // indirect
175+
github.com/moby/patternmatcher v0.6.1 // indirect
175176
github.com/moby/spdystream v0.5.1 // indirect
176177
github.com/moby/sys/sequential v0.6.0 // indirect
177178
github.com/moby/sys/user v0.4.0 // indirect
@@ -180,7 +181,6 @@ require (
180181
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
181182
github.com/modern-go/reflect2 v1.0.2 // indirect
182183
github.com/monochromegane/go-gitignore v0.0.0-20200626010858-205db1a8cc00 // indirect
183-
github.com/morikuni/aec v1.0.0 // indirect
184184
github.com/munnerz/goautoneg v0.0.0-20191010083416-a7dc8b61c822 // indirect
185185
github.com/mxk/go-flowrate v0.0.0-20140419014527-cca7078d478f // indirect
186186
github.com/opencontainers/go-digest v1.0.0 // indirect
@@ -191,7 +191,7 @@ require (
191191
github.com/pkg/errors v0.9.1 // indirect
192192
github.com/planetscale/vtprotobuf v0.6.1-0.20240319094008-0393e58bdf10 // indirect
193193
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
194-
github.com/power-devops/perfstat v0.0.0-20210106213030-5aafc221ea8c // indirect
194+
github.com/power-devops/perfstat v0.0.0-20240221224432-82ca36839d55 // indirect
195195
github.com/prometheus/client_golang v1.22.0 // indirect
196196
github.com/prometheus/client_model v0.6.2 // indirect
197197
github.com/prometheus/common v0.65.0 // indirect
@@ -202,16 +202,16 @@ require (
202202
github.com/russross/blackfriday/v2 v2.1.0 // indirect
203203
github.com/santhosh-tekuri/jsonschema/v6 v6.0.2 // indirect
204204
github.com/sergi/go-diff v1.3.2-0.20230802210424-5b0b94c5c0d3 // indirect
205-
github.com/shirou/gopsutil/v4 v4.25.1 // indirect
205+
github.com/shirou/gopsutil/v4 v4.26.3 // indirect
206206
github.com/shopspring/decimal v1.4.0 // indirect
207-
github.com/sirupsen/logrus v1.9.3 // indirect
207+
github.com/sirupsen/logrus v1.9.4 // indirect
208208
github.com/skeema/knownhosts v1.3.1 // indirect
209209
github.com/spf13/cast v1.7.0 // indirect
210210
github.com/spf13/cobra v1.9.1 // indirect
211211
github.com/spf13/pflag v1.0.7 // indirect
212212
github.com/spiffe/go-spiffe/v2 v2.6.0 // indirect
213-
github.com/tklauser/go-sysconf v0.3.12 // indirect
214-
github.com/tklauser/numcpus v0.6.1 // indirect
213+
github.com/tklauser/go-sysconf v0.3.16 // indirect
214+
github.com/tklauser/numcpus v0.11.0 // indirect
215215
github.com/ulikunitz/xz v0.5.15 // indirect
216216
github.com/vbatts/tar-split v0.12.1 // indirect
217217
github.com/x448/float16 v0.8.4 // indirect

0 commit comments

Comments
 (0)