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

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.

@github-actions
Copy link

github-actions bot commented Dec 3, 2025

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale due to inactivity. label Dec 3, 2025
@rbtr
Copy link
Collaborator Author

rbtr commented Dec 9, 2025

/azp run Azure Container Networking PR

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@rbtr rbtr enabled auto-merge December 9, 2025 17:47
@github-actions github-actions bot removed the stale Stale due to inactivity. label Dec 10, 2025
@github-actions
Copy link

This pull request is stale because it has been open for 2 weeks with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the stale Stale due to inactivity. label Dec 25, 2025
@github-actions
Copy link

github-actions bot commented Jan 1, 2026

Pull request closed due to inactivity.

@github-actions github-actions bot closed this Jan 1, 2026
auto-merge was automatically disabled January 1, 2026 00:02

Pull request was closed

@github-actions github-actions bot deleted the feat/kube-logr branch January 1, 2026 00:02
@rbtr rbtr restored the feat/kube-logr branch January 2, 2026 19:19
@rbtr rbtr reopened this Jan 2, 2026
@rbtr rbtr removed the stale Stale due to inactivity. label Jan 2, 2026
@rbtr
Copy link
Collaborator Author

rbtr commented Jan 2, 2026

/azp run Azure Container Networking PR

@rbtr rbtr enabled auto-merge January 2, 2026 19:20
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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