nhurel / terraspec

Terraform unit test framework
Mozilla Public License 2.0
79 stars 7 forks source link

Go get fails for 0.6.2 #11

Open Useurmind opened 3 years ago

Useurmind commented 3 years ago

Hi,

if I execute

go get github.com/nhurel/terraspec@0.6.2

the call fails with:

go: github.com/nhurel/terraspec 0.6.2 => v0.0.0-20201014212445-68dbde0cfbf6
go: finding module for package k8s.io/client-go/kubernetes/typed/coordination/v1
go: finding module for package github.com/peterbourgon/diskv
go: finding module for package github.com/gregjones/httpcache
go: finding module for package github.com/gregjones/httpcache/diskcache
go: finding module for package k8s.io/api/admissionregistration/v1alpha1
go: found k8s.io/client-go/kubernetes/typed/coordination/v1 in k8s.io/client-go v11.0.0+incompatible
go: found github.com/gregjones/httpcache in github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
go: found github.com/gregjones/httpcache/diskcache in github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
go: found github.com/peterbourgon/diskv in github.com/peterbourgon/diskv v2.0.1+incompatible
# k8s.io/client-go/rest
go\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)
PS C:\Users\jogruen> go get github.com/nhurel/terraspec@0.6.2
go: github.com/nhurel/terraspec 0.6.2 => v0.0.0-20201014212445-68dbde0cfbf6
go: finding module for package k8s.io/client-go/kubernetes/typed/coordination/v1
go: finding module for package k8s.io/api/admissionregistration/v1alpha1
go: finding module for package github.com/gregjones/httpcache
go: finding module for package github.com/peterbourgon/diskv
go: finding module for package github.com/gregjones/httpcache/diskcache
go: found k8s.io/client-go/kubernetes/typed/coordination/v1 in k8s.io/client-go v11.0.0+incompatible
go: found github.com/gregjones/httpcache in github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
go: found github.com/gregjones/httpcache/diskcache in github.com/gregjones/httpcache v0.0.0-20190611155906-901d90724c79
go: found github.com/peterbourgon/diskv in github.com/peterbourgon/diskv v2.0.1+incompatible
# k8s.io/client-go/rest
go\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)

This seems to be an issue with transitive dependencies. It looks like terraform 0.13 depends on client-go for some reason and does so by referencing v10.0.0+incompatible which is pretty old and not a go module. Seems like they have changed from major version 11 back to version 0 at some point and that is causing some trouble. The k8s api module does not have a major version yet and it seems to mix the very old client-go version with a new k8s api version.

I am still curious why terraform requires a reference to client-go because they should not be dependent on kubernetes.

Useurmind commented 3 years ago

Would it at least be possible to provide a binary release on the release page as long as this does not work. The last binary release is from the 0.5.0 version.

nhurel commented 3 years ago

I've just published the draft release that was built. I don't get why go build work but go get doesn't :thinking: