Skip to content

Conversation

@kommendorkapten
Copy link
Member

No description provided.

there is no need to copy the pod to the event object, the pod can be fetched
from the informers cache.
Copilot AI review requested due to automatic review settings December 16, 2025 15:15
Copy link

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 removes unnecessary deep copying of Pod objects in the controller's event handling. Instead of storing Pod copies in events, the controller now retrieves Pods directly from the informer's cache when processing events, reducing memory overhead and eliminating redundant data storage.

Key changes:

  • Removed Pod field from PodEvent struct
  • Modified event processing to fetch Pods from the informer's cache using the event key
  • Fixed a spelling error in an error message

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
internal/controller/controller.go Removed Pod field from PodEvent struct, eliminated DeepCopy() calls in event handlers, and updated processEvent to retrieve Pods from cache
cmd/deployment-tracker/main.go Fixed typo in error message ("Organiation" → "Organization")

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

@kommendorkapten kommendorkapten changed the title No copy Avoid copy pod in the event loop Dec 16, 2025
@kommendorkapten kommendorkapten merged commit 96b8f57 into main Dec 16, 2025
7 checks passed
@kommendorkapten kommendorkapten deleted the no-copy branch December 16, 2025 15:25
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.

1 participant