Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix "log.SetLogger(...) was never called" warning (#5095)
## Motivation System tests sometimes complain with a warning about this issue: ``` [controller-runtime] log.SetLogger(...) was never called; logs will not be displayed. Detected at: > goroutine 89 [running]: > runtime/debug.Stack() > /usr/local/go/src/runtime/debug/stack.go:24 +0x5e > sigs.k8s.io/controller-runtime/pkg/log.eventuallyFulfillRoot() > /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/log/log.go:60 +0xcd > sigs.k8s.io/controller-runtime/pkg/log.(*delegatingLogSink).WithName(0xc0001f3400, {0x1d7b101, 0x14}) > /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/log/deleg.go:147 +0x45 > github.com/go-logr/logr.Logger.WithName({{0x201aac0, 0xc0001f3400}, 0x0}, {0x1d7b101?, 0x1d63709?}) > /go/pkg/mod/github.com/go-logr/logr@v1.2.4/logr.go:336 +0x3d > sigs.k8s.io/controller-runtime/pkg/client.newClient(0x1d09720?, {0x0, 0xc003dfa3f0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0}) > /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/client/client.go:122 +0xec > sigs.k8s.io/controller-runtime/pkg/client.New(0x20024e0?, {0x0, 0xc003dfa3f0, {0x0, 0x0}, 0x0, {0x0, 0x0}, 0x0}) > /go/pkg/mod/sigs.k8s.io/controller-runtime@v0.16.2/pkg/client/client.go:103 +0x7d > github.com/spacemeshos/go-spacemesh/systest/testcontext.New(0xc000187380, {0xc0003c5f18, 0x1, 0x5ac?}) > /build/systest/testcontext/context.go:291 +0x32e > github.com/spacemeshos/go-spacemesh/systest/tests.TestPartition_30_70(0xc0001031e0?) > /build/systest/tests/partition_test.go:174 +0xc8 > testing.tRunner(0xc000187380, 0x1e6c4c0) > /usr/local/go/src/testing/testing.go:1595 +0xff > created by testing.(*T).Run in goroutine 1 > /usr/local/go/src/testing/testing.go:1648 +0x3ad ``` This PR tries to fix that warning ## Changes - set a logger for controller-runtime in system tests ## Test Plan n/a ## TODO <!-- This section should be removed when all items are complete --> - [x] Explain motivation or link existing issue(s) - [x] Test changes and document test plan - [x] Update documentation as needed - [x] Update [changelog](../CHANGELOG.md) as needed
- Loading branch information