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

Issues using simonpasquier/klog-gokit 2.1.0 with k8s.io/klog/v2 #20

Open
brian-avery opened this issue Aug 6, 2021 · 1 comment
Open

Comments

@brian-avery
Copy link

The README seems indicates that this should be compatible with k8s.io/klog/v2. However, when I attempt to substitute this in go.mod, I see:

vendor/istio.io/pkg/log/config.go:418:32: cannot use NewLogrAdapter(KlogScope) (type logr.Logger) as type "github.com/go-kit/kit/log".Logger in argument to klog.SetLogger:
	logr.Logger does not implement "github.com/go-kit/kit/log".Logger (missing Log method)

Removing the require override from go.mod causes the builder failure to go away.

@brian-avery brian-avery changed the title 2.1.0 doesn't seem to be compatible with k8s.io/klog/v2 Issues using simonpasquier/klog-gokit 2.1.0 with k8s.io/klog/v2 Aug 6, 2021
@brian-avery
Copy link
Author

brian-avery commented Aug 6, 2021

https://github.com/kubernetes/klog/blob/v2.0.0/klog.go uses "github.com/go-logr/logr", while

https://github.com/simonpasquier/klog-gokit/blob/v2.1.0/klog.go uses "github.com/go-kit/log"

github.com/go-kit/log requires implementation of this interface:

type Logger interface {
	Log(keyvals ...interface{}) error
}

which github.com/go-logr/logr does not implement. This causes issues when using dependencies that expect klog, but have it replaced with klog-gokit

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

1 participant