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/[email protected]+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/[email protected]
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
this is a duplicate of https://github.com/kubernetes/client-go/issues/691#issuecomment-535426503
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 Hi! Can you please say version for k8s.io/utils?
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
Most helpful comment
this is a duplicate of https://github.com/kubernetes/client-go/issues/691#issuecomment-535426503
The solution is to ensure you are using matching levels of k8s.io/{client-go,api,apimachinery} in your go.mod file, e.g.: