Skip to content

Conversation

@rbtr
Copy link
Collaborator

@rbtr rbtr commented Nov 18, 2025

wraps the v2 logger encoders with controller-runtime's kube-aware encoder shim

@rbtr rbtr requested a review from a team as a code owner November 18, 2025 00:55
@rbtr rbtr requested review from Copilot and paulyufan2 November 18, 2025 00:55
Copilot finished reviewing on behalf of rbtr November 18, 2025 00:58
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds Kubernetes-awareness to the CNS v2 logger by wrapping all standard zap encoders with controller-runtime's KubeAwareEncoder. This enhancement enables the logger to properly format Kubernetes object types (like ObjectMeta) when logging in Kubernetes environments.

Key changes:

  • Wraps logfmt and JSON encoders with KubeAwareEncoder for better Kubernetes object logging
  • Applies the wrapper consistently across stdout, file, and ETW logging cores
  • Adds controller-runtime import to each affected file

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
cns/logger/v2/cores/stdout.go Wraps logfmt encoder with KubeAwareEncoder for stdout logging
cns/logger/v2/cores/file.go Wraps JSON encoder with KubeAwareEncoder for file logging
cns/logger/v2/cores/etw_windows.go Wraps JSON encoder with KubeAwareEncoder for ETW logging on Windows

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Successfully merging this pull request may close these issues.

2 participants