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

add go module support, manage vendor directory using `go mod vendor` #74877

Merged
merged 9 commits into from Apr 3, 2019

Conversation

@liggitt
Copy link
Member

commented Mar 4, 2019

What type of PR is this?
/kind feature

What this PR does / why we need it:
part of https://github.com/kubernetes/enhancements/blob/master/keps/sig-architecture/2019-03-19-go-modules.md

This PR:

  • removes an unused dependency on go-ini
  • records our reliance on various build tools to inform go module resolution, using a dummy tools.go file which has a build tag (// +build tools) ensuring it doesn't get built, and which adds imports of other packages we depend on
  • creates hack/update-vendor.sh to generate and sync dependencies between the root and staging go.mod files, and to rebuild the vendor directory
  • creates hack/pin-dependency.sh to record a specific tag/sha for a dependency
  • updates hack/update-vendor-licenses.sh to generate the vendor license file from the vendored module listing
  • removes godep.json files
  • removes forked godep tool (and subsequently unused dependencies github.com/kr/text and github.com/kr/pretty)
  • updates client-go install documentation with details about module use

Notes for reviewer

The vendor changes in the update vendor commit are due to:

  • files for all build tags being included, which pulls in appengine-specific files via golang.org/x/oauth (xref golang/go#25873)
  • removed golang.org/x/net/internal/nettest, test code is not vendored
  • client-go doc changes are split into individual commits for ease of reviewing, will squash before merge

Which issue(s) this PR fixes:
xref #65683 #68577

Before merge:

Follow-ups:

`k8s.io/kubernetes` and published components (like `k8s.io/client-go` and `k8s.io/api`) now publish go module files containing dependency version information. See http://git.k8s.io/client-go/INSTALL.md#go-modules for details on consuming `k8s.io/client-go` using go modules.
@k8s-ci-robot

This comment has been minimized.

Copy link
Contributor

commented Mar 4, 2019

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: liggitt

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@liggitt

This comment has been minimized.

Copy link
Member Author

commented Mar 4, 2019

cc @dims @cblecker @sttts

since we started running into trouble with things like golang.org/x/net, I thought it was worth exploring what it would actually take to get a reproducible vendor dir using go modules

@liggitt liggitt force-pushed the liggitt:go-mod-cleanup branch from 6921b7b to d0261b1 Apr 3, 2019

@k8s-ci-robot k8s-ci-robot removed the lgtm label Apr 3, 2019

@liggitt

This comment has been minimized.

Copy link
Member Author

commented Apr 3, 2019

added "Update publishing bot smoke tests for go modules" commit pulling in changes tested in kubernetes/publishing-bot#169

@dims

This comment has been minimized.

Copy link
Member

commented Apr 3, 2019

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm label Apr 3, 2019

@liggitt

This comment has been minimized.

Copy link
Member Author

commented Apr 3, 2019

/retest

1 similar comment
@liggitt

This comment has been minimized.

Copy link
Member Author

commented Apr 3, 2019

/retest

@liggitt

This comment has been minimized.

Copy link
Member Author

commented Apr 3, 2019

publishing bot run was successful (see https://github.com/kubernetes-nightly/client-go/blob/master/go.mod for example output)

/hold cancel

@sttts sttts referenced this pull request Apr 3, 2019

Merged

go-mod support #169

@k8s-ci-robot k8s-ci-robot merged commit d920430 into kubernetes:master Apr 3, 2019

17 checks passed

cla/linuxfoundation liggitt authorized
Details
pull-kubernetes-bazel-build Job succeeded.
Details
pull-kubernetes-bazel-test Job succeeded.
Details
pull-kubernetes-conformance-image-test Skipped.
pull-kubernetes-cross Job succeeded.
Details
pull-kubernetes-e2e-gce Job succeeded.
Details
pull-kubernetes-e2e-gce-100-performance Job succeeded.
Details
pull-kubernetes-e2e-gce-device-plugin-gpu Job succeeded.
Details
pull-kubernetes-godeps Job succeeded.
Details
pull-kubernetes-integration Job succeeded.
Details
pull-kubernetes-kubemark-e2e-gce-big Job succeeded.
Details
pull-kubernetes-local-e2e Skipped.
pull-kubernetes-node-e2e Job succeeded.
Details
pull-kubernetes-typecheck Job succeeded.
Details
pull-kubernetes-verify Job succeeded.
Details
pull-publishing-bot-validate Job succeeded.
Details
tide In merge pool.
Details

@liggitt liggitt deleted the liggitt:go-mod-cleanup branch Apr 3, 2019

@fejta

This comment has been minimized.

Copy link
Contributor

commented Apr 3, 2019

When will the go.mod files be live on things like k8s.io/api? (and congrats!)

@liggitt

This comment has been minimized.

Copy link
Member Author

commented Apr 3, 2019

The publishing bot changes merged, a manual test run worked as expected (pushed to the kubernetes-nightly org). We're letting an automated test run pass tonight, then will push the new version of the bot live tomorrow morning.

staging repos like k8s.io/api and k8s.io/client-go should have go.mod files on master by EOD tomorrow.

@dgkanatsios dgkanatsios referenced this pull request Apr 8, 2019

Open

Use Go modules #882

@liggitt liggitt changed the title add go module support, manage vendor directory using go modules add go module support, manage vendor directory using `go mod vendor` Apr 12, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.