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

Use Go Modules #2647

Merged
merged 1 commit into from
Sep 30, 2020
Merged

Use Go Modules #2647

merged 1 commit into from
Sep 30, 2020

Conversation

mythri-garaga
Copy link
Contributor

@mythri-garaga mythri-garaga commented Sep 23, 2020

Summary

Use go modules

Implementation details

  • from agent/
go mod init
go mod tidy
rm -rf vendor
go mod vendor
  • removed dep files - ./agent/Gopkg.lock and ./agent/Gopkg.toml

Testing

New tests cover the changes:

Description for the changelog

Licensing

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

@mythri-garaga
Copy link
Contributor Author

mythri-garaga commented Sep 23, 2020

TestTaskMetadataValidator and TestV4TaskEndpointAWSVPCNetworkMode functional tests failing for al1, al2, inf, gpu.

@mythri-garaga
Copy link
Contributor Author

mythri-garaga commented Sep 24, 2020

Switching to "goMod" base branch since moving to go modules affects the make targets.

@mythri-garaga mythri-garaga changed the title Use Go Modules [WIP]Use Go Modules Sep 24, 2020
@mythri-garaga mythri-garaga changed the title [WIP]Use Go Modules Use Go Modules Sep 25, 2020
Copy link
Contributor

@fenxiong fenxiong left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

any idea why we need to update quite a few vendor packages as part of the change? is there a way to keep them unchanged?

@sparrc
Copy link
Contributor

sparrc commented Sep 29, 2020

any idea why we need to update quite a few vendor packages as part of the change? is there a way to keep them unchanged?

gomod automatically pins the same library versions from Gopkg, so it's not the library versions changing (I spot checked a few too).

Im not sure why there are so many differences in the vendor/ directory. I know that godep and gomod both have their own algorithms for determining if a package is unused. It seems like godep is generally a bit more aggressive in pruning unused vendored code.

If we want to use gomod I dont think there's any other option. You can't even leave it as-is and just avoid running go mod vendor (not that we should do that) because gomod checks that the contents of the vendor directory is consistent with it's view of the world.

@mythri-garaga
Copy link
Contributor Author

any idea why we need to update quite a few vendor packages as part of the change? is there a way to keep them unchanged?

gomod automatically pins the same library versions from Gopkg, so it's not the library versions changing (I spot checked a few too).

Im not sure why there are so many differences in the vendor/ directory. I know that godep and gomod both have their own algorithms for determining if a package is unused. It seems like godep is generally a bit more aggressive in pruning unused vendored code.

If we want to use gomod I dont think there's any other option. You can't even leave it as-is and just avoid running go mod vendor (not that we should do that) because gomod checks that the contents of the vendor directory is consistent with it's view of the world.

Thanks for explaining @sparrc

@mythri-garaga mythri-garaga merged commit a536fa0 into aws:goMod Sep 30, 2020
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.

4 participants