client-go icon indicating copy to clipboard operation
client-go copied to clipboard

go install failure

Open ghost opened this issue 2 years ago • 3 comments

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.

ghost avatar Jun 18 '22 23:06 ghost

up

darzanebor avatar Aug 05 '22 15:08 darzanebor

up

eXist-FraGGer avatar Aug 23 '22 08:08 eXist-FraGGer

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...

NordengenT avatar Nov 10 '22 12:11 NordengenT

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 avatar Jan 03 '23 12:01 nikhita

@nikhita: Closing this issue.

In response to this:

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

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 avatar Jan 03 '23 12:01 k8s-ci-robot

=( 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

darzanebor avatar Jan 07 '23 16:01 darzanebor

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.

evertramos avatar May 16 '23 14:05 evertramos

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

liggitt avatar May 16 '23 14:05 liggitt

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...

evertramos avatar May 16 '23 14:05 evertramos

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

liggitt avatar May 16 '23 15:05 liggitt

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)

liggitt avatar May 16 '23 15:05 liggitt

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.

evertramos avatar May 16 '23 15:05 evertramos

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 avatar May 16 '23 15:05 liggitt

@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.

evertramos avatar May 16 '23 15:05 evertramos