Open jpmcb opened 3 years ago
Curious – are you trying to add tanzu-framework
as a dependency or install tanzu
CLI using go get
? The go get github.com/vmware-tanzu/tanzu-framework/cmd/cli/tanzu@main
command is pointing to the main package and is generally what is used to install a binary (although the recommended way to do from Go 1.16+ is to use go install
).
But also you cannot add a main package like cmd/cli/tanzu
to your dependency. go get github.com/vmware-tanzu/tanzu-framework@main
should work though and will add an entry to your go.mod file.
The go get
is intended to populate a go module with the necessary dependencies for TCE where we run the tanzu CLI remotely like this:
TANZU_CLI_NO_INIT=true go run github.com/vmware-tanzu/tanzu-framework/cmd/cli/tanzu --help
This will only work in a module with the necessary dependencies declared. Otherwise, you hit this error:
no required module provides package github.com/vmware-tanzu/tanzu-framework/cmd/cli/tanzu
Therefore, we need the ability to go get
the package into a module to run the code.
Thanks! Interesting use case.
Bug description
In a brand new VM, in a fresh go module, I am unable to pull get the
cmd/cli/tanzu
package as a dependency:I believe this is related to the v0.7.0 controller-runtime dependency being incompatible with the v0.21 client-go dependency. I'm not 100% sure of the internal workings of go mod, but I was first suspicious of this seeing the
go/pkg/mod/sigs.k8s.io/controller-runtime@v0.7.0/
log lines in the go get error. Locally, if I bump thev0.7.0
dep tov0.9.0
it works. PR for this incomingThis issue may also be related: https://github.com/kubernetes-sigs/controller-runtime/issues/1473
Affected product area (please put an X in all that apply)
Expected behavior I would expect the library (and it's various packages) to always be "go getable" when using
go get
to grab dependencies. This mainly affects TCE as we pull down thecmd/cli/tanzu
package to build.Steps to reproduce the bug
go mod init example.com
cmd/cli/tanzu
dependency viago get github.com/vmware-tanzu/tanzu-framework/cmd/cli/tanzu@main
- see failuresVersion (include the SHA if the version is not obvious) Latest commits on
main
@ 9bb81197689f2405b24bfc79433302fd5085bbe8Environment where the bug was observed (cloud, OS, etc) Using Go 1.16
VM environment: