client-go
client-go copied to clipboard
go install failure
go install k8s.io/client-go@latest go: k8s.io/client-go@latest (in k8s.io/[email protected]): The go.mod file for the module providing named packages contains one or more replace directives. It must not contain directives that would cause it to be interpreted differently than if it were the main module.
up
up
Same here, Lens is depending on this installation. As a non go user forced to install dependencies through go, one should not be required to have any knowledge about go or its internal structures...
Please use go get
instead of go install
as listed in https://github.com/kubernetes/client-go/blob/master/INSTALL.md#using-a-specific-version.
Closing as installation is documented already. /close
@nikhita: Closing this issue.
In response to this:
Please use
go get
instead ofgo install
as listed in https://github.com/kubernetes/client-go/blob/master/INSTALL.md#using-a-specific-version.Closing as installation is documented already. /close
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.
=( closed because closed, issue is still here
(31/31) Installing go (1.19.4-r0)
Executing busybox-1.35.0-r29.trigger
OK: 709 MiB in 69 packages
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,
like 'go install example.com/cmd@latest'
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
go get k8s.io/client-go@latest returned a non-zero code: 1
Hello there!
When trying to use got get
I dot this message from go:
$ go get k8s.io/client-go@latest
go: go.mod file not found in current directory or any parent directory.
'go get' is no longer supported outside a module.
To build and install a command, use 'go install' with a version,
like 'go install example.com/cmd@latest'
For more information, see https://golang.org/doc/go-get-install-deprecation
or run 'go help get' or 'go help install'.
So I assume the version of go must be downgraded go to go1.16. 'get' does not exist in go1.18 any more.
client-go is a library, not a binary command
go get k8s.io/client-go@latest
is the command you use to add this library to a module you are developing
you have to run the go get
command inside your module's directory, where go can find your go.mod file to record the client-go version as a dependency
Hello @liggitt,
Thanks for you quick reply, but I am tring to install the client-go plugin, which is used by another script that uses kubectl. So, I might be mistaken... but go1.18 show that go get
does not exist anymore, it was deprecated (https://go.dev/doc/go-get-install-deprecation), so I instaled manually the go1.13:
wget https://golang.org/dl/go1.13.linux-amd64.tar.gz
sudo tar -xf go1.13.linux-amd64.tar.gz -C /usr/local
updated the .bashrc (ubuntu) file:
export PATH=/home/ubuntu/bin:$PATH:/usr/local/go/bin
export GO111MODULE=on
And then I was able to add the plugin with:
go get k8s.io/client-go@latest
Which in the end got this version:
go: finding k8s.io/client-go v11.0.0+incompatible
go: downloading k8s.io/client-go v11.0.0+incompatible
go: extracting k8s.io/client-go v11.0.0+incompatible
Am I missing something here? Or maybe I missplaced this library somehow...
Using go get
for downloading and building binary commands was deprecated and replaced with go install ...
. go get
is still the correct command to use to record dependency versions in go.mod files. See https://go.dev/doc/go-get-install-deprecation for details:
In Go 1.18, go get will no longer build packages; it will only be used to add, update, or remove dependencies in go.mod. Specifically, go get will always act as if the -d flag were enabled.
I'm not sure what you mean by:
I am trying to install the client-go plugin
client-go doesn't provide binary commands to install
I installed manually the go1.13
using an outdated go version is not recommended... that go release contains unfixed security vulnerabilities, and doesn't understand things like retracted versions so you are ending up pulling in a 4-year-old client-go version (https://github.com/kubernetes/client-go/releases/tag/v11.0.0)
I think I am really missing something here on my side. sorry for that:
Creaing a github self-hosted runner, I got this error from an oracle cloud cliet:
E0516 14:56:37.038801 2141 memcache.go:238] couldn't get current server API group list: Get "https://*.*.*.*:6443/api?timeout=32s": getting credentials: exec: executable oci not found
It looks like you are trying to use a client-go credential plugin that is not installed.
To learn more about this feature, consult the documentation available at:
https://kubernetes.io/docs/reference/access-authn-authz/authentication/#client-go-credential-plugins
For that reason I though would be necessary to install this kubectl plugin client-go credential, but somehow I dould not manage to do it.
E0516 14:56:37.038801 2141 memcache.go:238] couldn't get current server API group list: Get "https://...:6443/api?timeout=32s": getting credentials: exec: executable oci not found
It looks like you are trying to use a client-go credential plugin that is not installed.
yeah... your kubeconfig is set up to call out to an executable to get credentials, but the executable (oci
, it looks like) is not installed on your system or is not in your $PATH. That looks like the Oracle Cloud Infrastructure CLI (https://docs.oracle.com/en-us/iaas/Content/ContEng/Tasks/contengdownloadkubeconfigfile.htm)
@liggitt
Thank you very much for you help! oci was installed, but there were a extend package that must ge informed during the installation, which is the 'client-go', so with your help I was able to clarify it on my side. Sorry so many messages.