In this example obj is runtime.Object
:
// for some reason logger.With(...) doesn't work the best
logger.With(zap.Reflect("obj", obj)).Info("AAA")
// with kubeAware encoder, but this does
logger.Debug("BBB", zap.Reflect("obj", obj))
// it seems like zap doesn't pass .With(fields) fields to the EncodeEntry
// of the kubeAware encoder
Which seems super weird and error-prone. The logger is typical *zap.Logger
.
controller-runtime version v0.8.0
(I'll upgrade, but this code hasn't changed much since then)