wave-k8s / wave

Kubernetes configuration tracking controller
Apache License 2.0
646 stars 82 forks source link

go mods #107

Closed starkers closed 2 months ago

starkers commented 3 years ago

I wanted to bosh on this a little but before I start I've updated it to go mods incase thats handy?

starkers commented 3 years ago

Lots of updates done to the Makefiles to get everything working done

Stuck at go generate now as its attempting to pull content from the ../../vendor dep path.. I'll have to dig into this further to see how they're handling that in more recent versions of kube builder (I've not done much generating before)

image

starkers commented 3 years ago

Converting the PR to a draft as its WIP

JoelSpeed commented 2 years ago

That issue can be solved by creating a tools.go file that includes the tool dependency, eg following this https://marcofranssen.nl/manage-go-tools-via-go-modules

github-actions[bot] commented 2 years ago

This pull request has been inactive for 60 days. If the pull request is still relevant please comment to re-activate the pull request. If no action is taken within 7 days, the pull request will be marked closed.

toelke commented 3 months ago

Rebased to let the tests run.

I'll look at fixing the tests later or tomorrow.

mamccorm commented 3 months ago

Hey @toelke, I think I was able to repro the test failure locally. This seemed to fix it for me:

Dentrax commented 3 months ago

I've tried to combine this PR + Mark's but, but I couldn't able to compile the tests with: go test -c ./...:

# sigs.k8s.io/controller-runtime/pkg/log
../../../go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.2/pkg/log/log.go:48:31: cannot use NullLogger{} (value of type NullLogger) as logr.Logger value in argument to NewDelegatingLogger
../../../go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.2/pkg/log/null.go:30:21: cannot use NullLogger{} (value of type NullLogger) as logr.Logger value in variable declaration
../../../go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.2/pkg/log/null.go:48:37: undefined: logr.InfoLogger
../../../go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.2/pkg/log/null.go:54:9: cannot use log (variable of type NullLogger) as logr.Logger value in return statement
../../../go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.2/pkg/log/null.go:59:9: cannot use log (variable of type NullLogger) as logr.Logger value in return statement
../../../go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.2/pkg/log/deleg.go:103:9: cannot use res (variable of type *DelegatingLogger) as logr.Logger value in return statement
../../../go/pkg/mod/sigs.k8s.io/controller-runtime@v0.2.2/pkg/log/deleg.go:116:9: cannot use res (variable of type *DelegatingLogger) as logr.Logger value in return statement
# github.com/go-logr/glogr
../../../go/pkg/mod/github.com/go-logr/glogr@v0.1.0/glogr.go:18:9: cannot use glogger{…} (value of type glogger) as logr.Logger value in return statement
../../../go/pkg/mod/github.com/go-logr/glogr@v0.1.0/glogr.go:127:36: undefined: logr.InfoLogger
../../../go/pkg/mod/github.com/go-logr/glogr@v0.1.0/glogr.go:142:9: cannot use new (variable of type glogger) as logr.Logger value in return statement
../../../go/pkg/mod/github.com/go-logr/glogr@v0.1.0/glogr.go:148:9: cannot use new (variable of type glogger) as logr.Logger value in return statement
../../../go/pkg/mod/github.com/go-logr/glogr@v0.1.0/glogr.go:151:21: cannot use glogger{} (value of type glogger) as logr.Logger value in variable declaration
../../../go/pkg/mod/github.com/go-logr/glogr@v0.1.0/glogr.go:152:12: undefined: logr.InfoLogger
# github.com/go-logr/zapr
../../../go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:133:39: undefined: logr.InfoLogger
../../../go/pkg/mod/github.com/go-logr/zapr@v0.1.0/zapr.go:156:9: cannot use &zapLogger{…} (value of type *zapLogger) as logr.Logger value in return statement
toelke commented 2 months ago

I have merged #145. Thank you so much for the work in this PR!