Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go mod and vendor update #3551

Merged
merged 2 commits into from
Jan 30, 2023
Merged

go mod and vendor update #3551

merged 2 commits into from
Jan 30, 2023

Conversation

sparrc
Copy link
Contributor

@sparrc sparrc commented Jan 28, 2023

This is a follow-up to #3534, which was reverted because it caused a change in behavior in agent proxying behavior (see second commit message description).

This PR had long functional tests to verify all tests pass, including TestSquidProxy

Summary

Diffs of direct dependencies in go.mod file:
awslabs/go-config-generator-for-fluentd-and-fluentbit@55d4fd2...8959c62
d-tux/udev@82fe5be...a12666f
didip/tollbooth@v3.0.2...v4.0.2
moby/moby@77e06fd...bd33bbf
prometheus/client_golang@v0.9.4...v1.7.1
prometheus/client_model@14fe0d1...v0.2.0
prometheus/common@v0.4.1...v0.10.0
https://cs.opensource.google/go/x/net/+/1bab6f366d9ec8c152f8735b2e359822ef75e3bd...refs/tags/v0.5.0
https://cs.opensource.google/go/x/sys/+/87e55d71481061dc6dcfb9a4953c896af893c130...refs/tags/v0.4.0
https://cs.opensource.google/go/x/tools/+/ef97713d99aa4e69742aa68fd45a63247b5d3ea0...refs/tags/v0.1.12
grpc/grpc-go@v1.48.0...v1.52.0

Note these are reverting to an older version in this commit:
golang/mock@v1.4.1...v1.6.0

bbolt is reverting from 1.3.6 to 1.3.5, it appears the 1.3.6 release tag was never promoted to a release and never will be in bbolt repo (see 'latest' release is 1.3.5): https://github.com/etcd-io/bbolt
etcd-io/bbolt@v1.3.5...v1.3.6
also see etcd-io/bbolt#326

Implementation details

Go modules were re-inited to fix build dependencies.

Backwards-incompatible package changes were mostly pinned to versions that don't require any changes to the agent codebase (except for minor changes in tollbooth and winio packages), so almost all changes in this PR are in the vendor/ directory.

The docker library pinning breaks windows builds though, so as a temporary fix one file in that docker client library for windows is manually pinned to the latest version via curl (see below).

The rest of the libraries will be updated in phases in follow-up PRs (and will require agent code changes).

cd agent/
rm -rf go.mod go.sum vendor/
go mod init github.com/aws/amazon-ecs-agent/agent
# downgrade for ContainerCreate interface changes
go get github.com/docker/docker@v19.03.13
# downgrade because of breaking change in library path (/current package is gone) 
go get github.com/containernetworking/cni@v0.8.1
# downgrade because of breaking change in library path (/current package is gone)
go get github.com/containernetworking/plugins@v0.8.6
# downgrade because of breaking change in library path (cgroups/v2 is replaced by cgroups/cgroup2)
go get github.com/containerd/cgroups@v1.0.4
# downgrade for ASM SDK interface changes that break mocks and unit tests 
go get github.com/aws/aws-sdk-go@v1.36.0
go mod tidy
# fix minor github.com/didip/tollbooth int64 -> float64 type change in library:
vim handlers/task_server_setup.go +81
go mod vendor

temporary windows build fix:

curl -o "vendor/github.com/docker/docker/pkg/system/filesys_windows.go" "https://raw.githubusercontent.com/moby/moby/f058afc861c2f56bf9e97472e99df65c6493e694/pkg/system/filesys_windows.go"

Testing

unit tests, integ tests, functional tests

Ran "long" functional tests, verified all tests (including TestSquidProxy) passed.

Description for the changelog

Enhancement: Update go version in module file, update most vendored build dependencies to latest library.

Licensing

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

* go mod and vendor update

* unit test upd

* go mod tidy, go mod vendor on mac

* try to fix windows winio dependency change in docker lib

* hack: fix windows build

* upgrade containernetworking/plugins

* resolve some accidental downgrades

* fix github actions
golang.org/x/net/http/httpproxy changed it's behavior regarding the
HTTP_PROXY and HTTPS_PROXY env vars.

it was to fix this issue: golang/go#40909
and this is the change: https://go-review.googlesource.com/c/net/+/249440

After this change the HTTP_PROXY env var will be ignored for HTTPS requests,
you have to also set HTTPS_PROXY in order for HTTPS requests from the agent
to be proxied. This means that if there are customers setting HTTP_PROXY
but not HTTPS_PROXY, their requests will no longer be proxied.

Pin to an older version of the httpproxy package to avoid this behavior
change.

Copying the file in-repo so that we can upgrade the rest of
golang.org/x/net without issue, and also so that any potential future
uses of x/net/http/httpproxy do not collide with maintaining this
previous desired behavior.
@sparrc sparrc changed the title [wip] Go mod vendor update go mod and vendor update Jan 30, 2023
@sparrc sparrc merged commit 822c4eb into aws:dev Jan 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants