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

log.SetLogger(...) was never called; logs will not be displayed. #2622

Closed
Noamrok opened this issue Dec 14, 2023 · 2 comments
Closed

log.SetLogger(...) was never called; logs will not be displayed. #2622

Noamrok opened this issue Dec 14, 2023 · 2 comments

Comments

@Noamrok
Copy link

Noamrok commented Dec 14, 2023

Hi,

Since upgrading to controller runtime 0.16.3 we are having this issue when creating a new controller runtime client.
It's not a blocker to our pipeline, just another log

how to reproduce:

import "sigs.k8s.io/controller-runtime/pkg/client"
client, err := client.New(config, client.Options{})

full stacktrace:

[controller-runtime] log.SetLogger(...) was never called; logs will not be displayed.
Detected at:
        >  goroutine 1 [running]:
        >  runtime/debug.Stack()
        >       /usr/local/go/src/runtime/debug/stack.go:24 +0x6b
        >  sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot()
        >       /home/noam/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.3/pkg/log/log.go:60 +0xa5
        >  sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithName(0xc000683a00, {0x928297f, 0x14})
        >       /home/noam/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.3/pkg/log/deleg.go:147 +0x45
        >  github.com/go-logr/logr.Logger.WithName({{0x99b3660, 0xc000683a00}, 0x0}, {0x928297f, 0x14})
        >       /home/noam/go/pkg/mod/github.com/go-logr/logr@v1.2.0/logr.go:293 +0x56
        >  sigs.k8s.io/controller-runtime/pkg/client.newClient(0xc000d55b00, {0x0, 0x0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0})
        >       /home/noam/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.3/pkg/client/client.go:122 +0x139
        >  sigs.k8s.io/controller-runtime/pkg/client.New(0xc000d54b40, {0x0, 0x0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0})
        >       /home/noam/go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.3/pkg/client/client.go:103 +0xcc
@sbueringer
Copy link
Member

Sounds like you have to call log.SetLogger(...) and if you don't logs from controller-runtime will not be displayed

@Noamrok
Copy link
Author

Noamrok commented Dec 14, 2023

apparently it was in the breaking change release notes of 0.15.0, I will close this issue, thank you!
image (4)

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

2 participants