From 215e6e06cbf4dbd617bcfbea0c69708468f8ec0d Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Tue, 21 Feb 2023 08:10:52 -0300 Subject: [PATCH 1/7] Override network mtu value --- go.mod | 12 ++++++++++++ go.sum | 7 +++++++ pkg/compose/create.go | 13 +++++++++++++ 3 files changed, 32 insertions(+) diff --git a/go.mod b/go.mod index 3ef547e14d4..82de72d0a30 100644 --- a/go.mod +++ b/go.mod @@ -61,6 +61,8 @@ require ( tags.cncf.io/container-device-interface v1.0.0 ) +require github.com/vishvananda/netlink v1.3.1-0.20240922070040-084abd93d350 + require ( dario.cat/mergo v1.0.1 // indirect github.com/AdaLogics/go-fuzz-headers v0.0.0-20240806141605-e8a1dd7889d6 // indirect @@ -168,6 +170,7 @@ require ( github.com/tonistiigi/go-csvvalue v0.0.0-20240710180619-ddb21b71c0b4 // indirect github.com/tonistiigi/units v0.0.0-20180711220420-6950e57a87ea // indirect github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab // indirect + github.com/vishvananda/netns v0.0.5 // indirect github.com/x448/float16 v0.8.4 // indirect github.com/xeipuuv/gojsonpointer v0.0.0-20190905194746-02993c407bfb // indirect github.com/xeipuuv/gojsonreference v0.0.0-20180127040603-bd5ef7bd5415 // indirect @@ -205,3 +208,12 @@ require ( sigs.k8s.io/structured-merge-diff/v4 v4.4.1 // indirect sigs.k8s.io/yaml v1.4.0 // indirect ) + +replace ( + // Override for e2e tests + github.com/cucumber/godog => github.com/laurazard/godog v0.0.0-20220922095256-4c4b17abdae7 + + // v1.2.1-beta.2 is the latest version, override to use v1.1.0 to avoid beta + // https://github.com/vishvananda/netlink/compare/v1.1.0...v1.2.1-beta.2 + github.com/vishvananda/netlink => github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5 +) diff --git a/go.sum b/go.sum index 702a28a7262..3d45002d657 100644 --- a/go.sum +++ b/go.sum @@ -486,6 +486,11 @@ github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab h1:H6aJ0yKQ0gF49Q github.com/tonistiigi/vt100 v0.0.0-20240514184818-90bafcd6abab/go.mod h1:ulncasL3N9uLrVann0m+CDlJKWsIAP34MPcOJF6VRvc= github.com/vbatts/tar-split v0.11.6 h1:4SjTW5+PU11n6fZenf2IPoV8/tz3AaYHMWjf23envGs= github.com/vbatts/tar-split v0.11.6/go.mod h1:dqKNtesIOr2j2Qv3W/cHjnvk9I8+G7oAkFDFN6TCBEI= +github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5 h1:+UB2BJA852UkGH42H+Oee69djmxS3ANzl2b/JtT1YiA= +github.com/vishvananda/netlink v1.1.1-0.20210330154013-f5de75959ad5/go.mod h1:twkDnbuQxJYemMlGd4JFIcuhgX83tXhKS2B/PRMpOho= +github.com/vishvananda/netns v0.0.0-20200728191858-db3c7e526aae/go.mod h1:DD4vA1DwXk04H54A1oHXtwZmA0grkVMdPxx/VGLCah0= +github.com/vishvananda/netns v0.0.5 h1:DfiHV+j8bA32MFM7bfEunvT8IAqQ/NzSJHtcmW5zdEY= +github.com/vishvananda/netns v0.0.5/go.mod h1:SpkAiCQRtJ6TvvxPnOSyH3BMl6unz3xZlaprSwhNNJM= github.com/x448/float16 v0.8.4 h1:qLwI1I70+NjRFUR3zs1JPUCgaCXSh3SW62uAKT1mSBM= github.com/x448/float16 v0.8.4/go.mod h1:14CWIYCyZA/cWjXOioeEpHeN/83MdbZDRQHoFcYsOfg= github.com/xeipuuv/gojsonpointer v0.0.0-20180127040702-4e3ac2762d5f/go.mod h1:N2zxlSyiKSe5eX1tZViRH5QA0qijqEDrYZiPEAiq3wU= @@ -587,6 +592,8 @@ golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7w golang.org/x/sys v0.0.0-20190801041406-cbf593c0f2f3/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191120155948-bd437916bb0e/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200217220822-9197077df867/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20200728102440-3e129f6d46b1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210331175145-43e1dd70ce54/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= diff --git a/pkg/compose/create.go b/pkg/compose/create.go index ddd4898cbd8..d63a2b70eb0 100644 --- a/pkg/compose/create.go +++ b/pkg/compose/create.go @@ -48,6 +48,7 @@ import ( "github.com/docker/docker/errdefs" "github.com/docker/go-connections/nat" "github.com/sirupsen/logrus" + "github.com/vishvananda/netlink" cdi "tags.cncf.io/container-device-interface/pkg/parser" ) @@ -1349,6 +1350,18 @@ func (s *composeService) resolveOrCreateNetwork(ctx context.Context, project *ty createOpts.IPAM.Config = append(createOpts.IPAM.Config, config) } + // override MTU value and set custom MTU one. + // This is required for gitpod.io due to the veth change + // https://github.com/gitpod-io/gitpod/pull/8955 + if createOpts.Options == nil { + createOpts.Options = make(map[string]string) + } + + netIface, err := netlink.LinkByName("ceth0") + if err == nil { + createOpts.Options["com.docker.network.driver.mtu"] = fmt.Sprintf("%v", netIface.Attrs().MTU) + } + networkEventName := fmt.Sprintf("Network %s", n.Name) w := progress.ContextWriter(ctx) w.Event(progress.CreatingEvent(networkEventName)) From 20ac552bdef13bda6ed4a8bb5dd944db5cf1e40c Mon Sep 17 00:00:00 2001 From: Kyle Brennan Date: Mon, 20 Feb 2023 15:44:14 +0000 Subject: [PATCH 2/7] Sync interface name with `docker-up` and `nsinsider` Context: https://github.com/gitpod-io/gitpod/pull/16368#issuecomment-1437114679 --- pkg/compose/create.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pkg/compose/create.go b/pkg/compose/create.go index d63a2b70eb0..cacd2faf6de 100644 --- a/pkg/compose/create.go +++ b/pkg/compose/create.go @@ -1350,6 +1350,12 @@ func (s *composeService) resolveOrCreateNetwork(ctx context.Context, project *ty createOpts.IPAM.Config = append(createOpts.IPAM.Config, config) } + // override MTU value and set custom MTU one. + // This is required for gitpod.io due to the veth change + // https://github.com/gitpod-io/gitpod/pull/8955 + if createOpts.Options == nil { + createOpts.Options = make(map[string]string) + } // override MTU value and set custom MTU one. // This is required for gitpod.io due to the veth change // https://github.com/gitpod-io/gitpod/pull/8955 From 3f86658935aa188675c1ac2b437b690cce131bc6 Mon Sep 17 00:00:00 2001 From: Manuel Alejandro de Brito Fontes Date: Tue, 21 Feb 2023 08:27:14 -0300 Subject: [PATCH 3/7] Only build linux/amd64 binary --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d7eb00dea6..1fe7f286454 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -34,7 +34,7 @@ jobs: name: Create matrix id: platforms run: | - echo matrix=$(docker buildx bake binary-cross --print | jq -cr '.target."binary-cross".platforms') >> $GITHUB_OUTPUT + echo ::set-output name=matrix::'["linux/amd64"]' - name: Show matrix run: | From 3b43c9ebd71e55d0c5bef987584e883516e94181 Mon Sep 17 00:00:00 2001 From: aledbf Date: Mon, 22 May 2023 22:46:47 +0000 Subject: [PATCH 4/7] Update gocyclo configuration --- .golangci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.golangci.yml b/.golangci.yml index 090e12151d8..152ef291b65 100644 --- a/.golangci.yml +++ b/.golangci.yml @@ -66,7 +66,7 @@ linters-settings: - unnamedResult - whyNoLint gocyclo: - min-complexity: 16 + min-complexity: 18 lll: line-length: 200 issues: From 00633511c1546b541b678d624d37537e8f2ac16e Mon Sep 17 00:00:00 2001 From: Kyle Brennan Date: Mon, 7 Aug 2023 18:55:56 +0000 Subject: [PATCH 5/7] Avoid validate-docs as part of validation --- .github/workflows/ci.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1fe7f286454..a6a1889a4b8 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -49,7 +49,6 @@ jobs: - lint - validate-go-mod - validate-headers - - validate-docs steps: - name: Checkout From 8d56c334bf30dd432fc94df59057003110ebb059 Mon Sep 17 00:00:00 2001 From: WVerlaek Date: Tue, 19 Sep 2023 13:31:56 +0000 Subject: [PATCH 6/7] Fix debug_enabled workflow input --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index a6a1889a4b8..73c27af0562 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,7 +16,7 @@ on: debug_enabled: description: 'To run with tmate enter "debug_enabled"' required: false - default: "false" + default: "" permissions: contents: read # to fetch code (actions/checkout) From 6ff0d34814101fbd5b189978872240dc546aa6e4 Mon Sep 17 00:00:00 2001 From: Kyle Brennan Date: Mon, 29 Apr 2024 21:39:25 +0000 Subject: [PATCH 7/7] Add .gitpod.yml --- .gitpod.yml | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitpod.yml diff --git a/.gitpod.yml b/.gitpod.yml new file mode 100644 index 00000000000..2f796628513 --- /dev/null +++ b/.gitpod.yml @@ -0,0 +1 @@ +image: gitpod/workspace-full:2024-04-16-12-16-24