Skip to content

go mod tidy fails in kubernetes/kubernetes on go1.13 #82506

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

Closed
fejta opened this issue Sep 9, 2019 · 11 comments · Fixed by #82805
Closed

go mod tidy fails in kubernetes/kubernetes on go1.13 #82506

fejta opened this issue Sep 9, 2019 · 11 comments · Fixed by #82805
Assignees
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Milestone

Comments

@fejta
Copy link
Contributor

fejta commented Sep 9, 2019

https://github.com/golang/go/wiki/Modules#how-to-prepare-for-a-release specifies that we should run go mod tidy before a release to ensure our go.mod file is limited to the set of imports we actually need.

However this currently fails:

$ go mod tidy
warning: ignoring symlink /usr/local/google/home/fejta/src/gh/kubernetes/bazel-bin
warning: ignoring symlink /usr/local/google/home/fejta/src/gh/kubernetes/bazel-genfiles
warning: ignoring symlink /usr/local/google/home/fejta/src/gh/kubernetes/bazel-kubernetes
warning: ignoring symlink /usr/local/google/home/fejta/src/gh/kubernetes/bazel-out
warning: ignoring symlink /usr/local/google/home/fejta/src/gh/kubernetes/bazel-testlogs
warning: ignoring symlink /usr/local/google/home/fejta/src/gh/kubernetes/cluster/gce/cos
warning: ignoring symlink /usr/local/google/home/fejta/src/gh/kubernetes/cluster/gce/custom
warning: ignoring symlink /usr/local/google/home/fejta/src/gh/kubernetes/cluster/gce/ubuntu
go: downloading golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
go: downloading golang.org/x/crypto v0.0.0-20181025213731-e84da0312774
go: downloading golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a
go: downloading golang.org/x/sys v0.0.0-20190209173611-3b5209105503
go: extracting golang.org/x/time v0.0.0-20161028155119-f51c12702a4d
go: downloading golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1
go: extracting golang.org/x/oauth2 v0.0.0-20190402181905-9f3314589c9a
go: extracting golang.org/x/lint v0.0.0-20181217174547-8f45f776aaf1
go: extracting golang.org/x/crypto v0.0.0-20181025213731-e84da0312774
go: extracting golang.org/x/sys v0.0.0-20190209173611-3b5209105503
go: downloading golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db
go: downloading golang.org/x/sync v0.0.0-20181108010431-42b317875d0f
go: extracting golang.org/x/sync v0.0.0-20181108010431-42b317875d0f
go: extracting golang.org/x/text v0.3.1-0.20181227161524-e6919f6577db
k8s.io/kubernetes/kubernetes/cluster/images/etcd/migrate imports
	k8s.io/kubernetes/third_party/forked/etcd221/wal: cannot find module providing package k8s.io/kubernetes/third_party/forked/etcd221/wal
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes imports
	k8s.io/kubernetes/pkg/api: cannot find module providing package k8s.io/kubernetes/pkg/api
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes imports
	k8s.io/kubernetes/pkg/api/v1: cannot find module providing package k8s.io/kubernetes/pkg/api/v1
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes imports
	k8s.io/kubernetes/pkg/client/clientset_generated/clientset: cannot find module providing package k8s.io/kubernetes/pkg/client/clientset_generated/clientset
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes imports
	k8s.io/kubernetes/pkg/volume/util/volumehelper: cannot find module providing package k8s.io/kubernetes/pkg/volume/util/volumehelper
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/executors/kubeexec imports
	github.com/heketi/heketi/pkg/remoteexec/kube imports
	k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/core/v1: cannot find module providing package k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/core/v1
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/executors/kubeexec imports
	github.com/heketi/heketi/pkg/remoteexec/kube imports
	k8s.io/kubernetes/pkg/client/unversioned/remotecommand: cannot find module providing package k8s.io/kubernetes/pkg/client/unversioned/remotecommand
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes tested by
	github.com/heketi/heketi/pkg/kubernetes.test imports
	k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake: cannot find module providing package k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake

Slightly hard to understand how to parse this output. Are these due to circular dependencies?

ref #81878

@fejta fejta added the kind/bug Categorizes issue or PR as related to a bug. label Sep 9, 2019
@k8s-ci-robot
Copy link
Contributor

@fejta: There are no sig labels on this issue. Please add a sig label by either:

  1. mentioning a sig: @kubernetes/sig-<group-name>-<group-suffix>
    e.g., @kubernetes/sig-contributor-experience-<group-suffix> to notify the contributor experience sig, OR

  2. specifying the label manually: /sig <group-name>
    e.g., /sig scalability to apply the sig/scalability label

Note: Method 1 will trigger an email to the group. See the group list.
The <group-suffix> in method 1 has to be replaced with one of these: bugs, feature-requests, pr-reviews, test-failures, proposals.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Sep 9, 2019
@fejta fejta added sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Sep 9, 2019
@liggitt
Copy link
Member

liggitt commented Sep 9, 2019

we run go mod tidy in this repo as part of hack/update-vendor.sh (and verify it runs in the verify-dependencies CI job)

What version of go are you running?

@liggitt
Copy link
Member

liggitt commented Sep 9, 2019

And is that on a clean working directory?

@liggitt
Copy link
Member

liggitt commented Sep 9, 2019

See

echo "=== tidying root" >> "${LOG_FILE}"
go mod tidy >>"${LOG_FILE}" 2>&1

@liggitt liggitt added the triage/needs-information Indicates an issue needs more information in order to work on it. label Sep 9, 2019
@liggitt liggitt self-assigned this Sep 9, 2019
@fejta
Copy link
Contributor Author

fejta commented Sep 9, 2019

Yes, clean working directory. Using go1.13rc1.

fejta@fejta3:~/src/gh/kubernetes$ go version
go version go1.13rc1 linux/amd64
fejta@fejta3:~/src/gh/kubernetes$ git reset --hard HEAD
HEAD is now at 6348200c92 Merge pull request #82501 from losipiuk/lo/ca-1.16-final
fejta@fejta3:~/src/gh/kubernetes$ git status
On branch rbe
nothing to commit, working tree clean
fejta@fejta3:~/src/gh/kubernetes$ git log
commit 6348200c92dec8848e55552f3e8039b3da95bd91 (HEAD -> rbe, upstream/master, origin/master, origin/HEAD)
Merge: 35cf6b6cbc b27e0b54f1
Author: Kubernetes Prow Robot <k8s-ci-robot@users.noreply.github.com>
Date:   Mon Sep 9 14:12:54 2019 -0700

    Merge pull request #82501 from losipiuk/lo/ca-1.16-final
    
    Update Cluster Autoscaler version to 1.16.0
fejta@fejta3:~/src/gh/kubernetes$ go mod tidy
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes tested by
	github.com/heketi/heketi/pkg/kubernetes.test imports
	k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake: cannot find module providing package k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake

@fejta
Copy link
Contributor Author

fejta commented Sep 9, 2019

Will try on a clean VM using both go1.12 and go1.13

@fejta
Copy link
Contributor Author

fejta commented Sep 9, 2019

Works on 1.12, fails on 1.13:

fejta@erick:~/kubernetes$ ~/go1.12/bin/go mod tidy
warning: ignoring symlink /home/fejta/kubernetes/cluster/gce/cos
warning: ignoring symlink /home/fejta/kubernetes/cluster/gce/custom
warning: ignoring symlink /home/fejta/kubernetes/cluster/gce/ubuntu
fejta@erick:~/kubernetes$ ~/go1.13/bin/go mod tidy
warning: ignoring symlink /home/fejta/kubernetes/cluster/gce/cos
warning: ignoring symlink /home/fejta/kubernetes/cluster/gce/custom
warning: ignoring symlink /home/fejta/kubernetes/cluster/gce/ubuntu
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes imports
	k8s.io/kubernetes/pkg/api: cannot find module providing package k8s.io/kubernetes/pkg/api
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes imports
	k8s.io/kubernetes/pkg/api/v1: cannot find module providing package k8s.io/kubernetes/pkg/api/v1
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes imports
	k8s.io/kubernetes/pkg/client/clientset_generated/clientset: cannot find module providing package k8s.io/kubernetes/pkg/client/clientset_generated/clientset
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes imports
	k8s.io/kubernetes/pkg/volume/util/volumehelper: cannot find module providing package k8s.io/kubernetes/pkg/volume/util/volumehelper
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/executors/kubeexec imports
	github.com/heketi/heketi/pkg/remoteexec/kube imports
	k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/core/v1: cannot find module providing package k8s.io/kubernetes/pkg/client/clientset_generated/clientset/typed/core/v1
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/executors/kubeexec imports
	github.com/heketi/heketi/pkg/remoteexec/kube imports
	k8s.io/kubernetes/pkg/client/unversioned/remotecommand: cannot find module providing package k8s.io/kubernetes/pkg/client/unversioned/remotecommand
k8s.io/kubernetes/pkg/volume/glusterfs imports
	github.com/heketi/heketi/client/api/go-client tested by
	github.com/heketi/heketi/client/api/go-client.test imports
	github.com/heketi/heketi/apps/glusterfs imports
	github.com/heketi/heketi/pkg/kubernetes tested by
	github.com/heketi/heketi/pkg/kubernetes.test imports
	k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake: cannot find module providing package k8s.io/kubernetes/pkg/client/clientset_generated/clientset/fake
fejta@erick:~/kubernetes$

@fejta fejta changed the title go mod tidy should work in kubernetes/kubernetes go mod tidy fails in kubernetes/kubernetes on go1.13 Sep 9, 2019
@liggitt
Copy link
Member

liggitt commented Sep 9, 2019

there's a fair number of build/releng issues we'll have to deal with for go1.13

xref #78845

@liggitt
Copy link
Member

liggitt commented Sep 9, 2019

/remove-sig architecture
/sig api-machinery

@k8s-ci-robot k8s-ci-robot added sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery. and removed sig/architecture Categorizes an issue or PR as relevant to SIG Architecture. labels Sep 9, 2019
@liggitt liggitt added this to the v1.17 milestone Sep 9, 2019
@liggitt liggitt added priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. and removed triage/needs-information Indicates an issue needs more information in order to work on it. labels Sep 9, 2019
@liggitt
Copy link
Member

liggitt commented Sep 9, 2019

looks like go mod tidy in go1.13 might now require all transitively referenced packages in dependencies to resolve, even ones we don't actually depend on in our tree (go1.12 did not require that, so because we didn't actually depend on any of the heketi packages that used the old client-go, we weren't affected by its outdated client-go dependency).

that means the outdated k8s.io/client-go library the current version of the heketi dependency uses will not work properly

xref heketi/heketi#1542

@zouyee
Copy link
Member

zouyee commented Sep 10, 2019

GO111MODULE=off GOOGLE_APPLICATION_CREDENTIALS=./kubernetes-8d07a080f91f.json make test-e2e-node PARALLELISM=1 REMOTE=true FOCUS="CriticalPod" SKIP=""
+++ [0910 09:45:36] Building go targets for linux/amd64:
    vendor/github.com/onsi/ginkgo/ginkgo
go/build: importGo k8s.io/kubernetes: exit status 1
can't load package: package k8s.io/kubernetes: cannot find module providing package k8s.io/kubernetes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. sig/api-machinery Categorizes an issue or PR as relevant to SIG API Machinery.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants