kubectl-dig
kubectl-dig copied to clipboard
Installation fails on Go 1.12.5
$ go version
go version go1.12.5 darwin/amd64
$ go get -u github.com/sysdiglabs/kubectl-dig/cmd/kubectl-di
...
# k8s.io/client-go/rest
../../.asdf/installs/golang/1.12.5/packages/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)
@garethr make install works fine (I am using the same version as you). But you are right, updating dependencies causes the error. I am currently looking into it.
this method in go-client has changed - https://github.com/kubernetes/client-go/blob/master/rest/request.go#L598 (additional error arg) I have updated dependencies and now it seems to be working PR - https://github.com/sysdiglabs/kubectl-dig/pull/3
Can you give it a try?
I can confirm that this worked for me, thanks. The following successfully compiles the binary:
env GO111MODULE="on" go get -u github.com/sysdiglabs/kubectl-dig/cmd/kubectl-dig@7a9e0fde35b808bd7c5ff982769b688aa52c34b0
@garethr would be good to update Makefile as well (to set GO111MODULE=on):
${kubectl_dig}:
GO111MODULE=on $(GO) build ${LDFLAGS} -o $@ ./cmd/kubectl-dig
I'll do that when this is merged
also failed with go 1.13
go: github.com/sysdiglabs/kubectl-dig/cmd/kubectl-dig imports
github.com/sysdiglabs/kubectl-dig/pkg/cmd imports
github.com/sysdiglabs/kubectl-dig/pkg/attacher imports
k8s.io/kubernetes/pkg/kubectl/util/term imports
github.com/docker/docker/pkg/term imports
github.com/docker/docker/pkg/term/windows imports
github.com/Sirupsen/logrus: github.com/Sirupsen/[email protected]: parsing go.mod:
module declares its path as: github.com/sirupsen/logrus
but was required as: github.com/Sirupsen/logrus
also failed with go 1.16.5 darwin/amd64
❯ GO111MODULE=on go get -u github.com/sysdiglabs/kubectl-dig/cmd/kubectl-dig
go get: github.com/docker/[email protected] updating to
github.com/docker/[email protected]: parsing go.mod:
module declares its path as: github.com/moby/spdystream
but was required as: github.com/docker/spdystream
go get -u github.com/sysdiglabs/kubectl-dig/cmd/kubectl-dig go: downloading k8s.io/apimachinery v0.22.2 go: downloading k8s.io/cli-runtime v0.22.2 go: downloading k8s.io/api v0.22.2 go: downloading k8s.io/utils v0.0.0-20210930125809-cb0fa318a74b go: downloading k8s.io/kubernetes v1.22.2 go: downloading golang.org/x/net v0.0.0-20210929193557-e81a3d93ecf6 go: downloading cloud.google.com/go v0.97.0 go: downloading sigs.k8s.io/yaml v1.3.0 go: downloading golang.org/x/crypto v0.0.0-20210921155107-089bfa567519 go: downloading k8s.io/kube-openapi v0.0.0-20210929172449-94abcedd1aa4 go: downloading golang.org/x/sys v0.0.0-20211003122950-b1ebd4e1001c go: downloading github.com/json-iterator/go v1.1.12 go: downloading github.com/modern-go/reflect2 v1.0.2 go get: github.com/docker/[email protected] updating to github.com/docker/[email protected]: parsing go.mod: module declares its path as: github.com/moby/spdystream but was required as: github.com/docker/spdystream
go version go version go1.16.6 linux/amd64