$ go list ./staging/src/k8s.io/api/core/v1 main module (k8s.io/kubernetes) does not contain package k8s.io/kubernetes/staging/src/k8s.io/api/core/v1 $ (cd ./staging/src/k8s.io/api/; go list -m; go list ./core/v1) k8s.io/api k8s.io/api/core/v1
to operations on workspaces. Note that support for workspaces is built into many other commands, not just 'go work'. See 'go help modules' for information about Go's module system of which workspaces are a part. See https://go.dev/ref/mod#workspaces for an in-depth reference on workspaces. See https://go.dev/doc/tutorial/workspaces for an introductory tutorial on workspaces. A workspace is specified by a go.work file that specifies a set of module directories with the "use" directive. These modules are used as root modules by the go command for builds and related operations. A workspace that does not specify modules to be used cannot be used to do builds from local modules.
./staging/src/k8s.io/apiextensions-apiserver ./staging/src/k8s.io/apimachinery ./staging/src/k8s.io/apiserver ./staging/src/k8s.io/cli-runtime ./staging/src/k8s.io/client-go $ go list ./pkg/proxy/iptables/ k8s.io/kubernetes/pkg/proxy/iptables $ go list ./staging/src/k8s.io/api/core/v1 k8s.io/api/core/v1
--- a/hack/lib/golang.sh +++ b/hack/lib/golang.sh @@ -565,6 +565,9 @@ kube::golang::setup_env() { # This seems to matter to some tools export GO15VENDOREXPERIMENT=1 + + # Explicitly turn on modules. + export GO111MODULE=on } # kube::golang::setup_env will check that the `go` commands is available in
of gengo - totally overhaul how flags are passed, it doesn’t work well any more - lots of badness in partial-failure cases * Lots of newly touched code still needs test changes * Figure out what to do with vendoring * Fix all corner-cases and FIXME comments * Back-pop gengo changes as gengo/v2 * Fix last “GOPATH” and “vendor” and “GO111MODULE” references * Try CI again (LOL, prechecks go boom!) * Make commits as clean as possible * Fix remaining hack/* scripts
commits • 1404 changed files • +55,748, −48,440 LOC • Not done yet Most of that is generated files with incidental changes (whew!) • Still going to be a BEAR to review ETA: Kubernetes v1.27.x Special thanks to the Go team, in particular Michael Matloob! Status
• manifests as slow tools, forcing us towards more monolithic codegen • also manifests as slow and memory-hoggy gopls • OTOH: slowness prompted a huge Makefile simplification Lack of support for vendoring leaves us to figure it out on our own • Go’s module proxy does not guarantee “forever” cache • We have been burned by modules disappearing • Use-case: clone repo, get on a plane, hack -- does not work now! Issues