Skip to content
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

not enough arguments in call to watch.NewStreamWatcher #766

Closed
ghost opened this issue Mar 11, 2020 · 3 comments
Closed

not enough arguments in call to watch.NewStreamWatcher #766

ghost opened this issue Mar 11, 2020 · 3 comments

Comments

@ghost
Copy link

ghost commented Mar 11, 2020

I am using minikube and i have a pod with service account .I am trying to run main.go with example codes but it gives me below error:

go: downloading github.com/spf13/pflag v1.0.5
go: finding github.com/imdario/mergo v0.3.8
go: finding golang.org/x/time latest
go: downloading github.com/imdario/mergo v0.3.8
go: extracting github.com/spf13/pflag v1.0.5
go: finding k8s.io/utils latest
go: finding golang.org/x/oauth2 latest
go: extracting github.com/imdario/mergo v0.3.8
go: finding github.com/spf13/pflag v1.0.5
# k8s.io/client-go/rest
pkg/mod/k8s.io/client-go@v11.0.0+incompatible/rest/request.go:598:31: not enough arguments in call to watch.NewStreamWatcher
        have (*versioned.Decoder)
        want (watch.Decoder, watch.Reporter)

kubectl version

Client Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.2", GitCommit:"59603c6e503c87169aea6106f57b9f242f64df89", GitTreeState:"clean", BuildDate:"2020-01-18T23:30:10Z", GoVersion:"go1.13.5", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"17", GitVersion:"v1.17.0", GitCommit:"70132b0f130acc0bed193d9ba59dd186f0e634cf", GitTreeState:"clean", BuildDate:"2019-12-07T21:12:17Z", GoVersion:"go1.13.4", Compiler:"gc", Platform:"linux/amd64"}

I get package with :
go get k8s.io/client-go@v0.17.0

and i am trying to run:

https://github.com/kubernetes/client-go/blob/master/examples/create-update-delete-deployment/main.go

I just try this command: go run main.go

@liggitt
Copy link
Member

liggitt commented Mar 11, 2020

this is a duplicate of #691 (comment)

The solution is to ensure you are using matching levels of k8s.io/{client-go,api,apimachinery} in your go.mod file, e.g.:

require (
  k8s.io/api v0.17.3
  k8s.io/apimachinery v0.17.3
  k8s.io/client-go v0.17.3
)

@liggitt liggitt closed this as completed Mar 11, 2020
@Asgoret
Copy link

Asgoret commented Jul 8, 2020

@liggitt Hi! Can you please say version for k8s.io/utils?

@liggitt
Copy link
Member

liggitt commented Jul 8, 2020

Can you please say version for k8s.io/utils?

Use the version that matches the version of client-go you are using. For example:

https://github.com/kubernetes/client-go/blob/v0.17.3/go.mod#L34

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants