Files
kubernetes/pkg
Swati Sehgal e06abce75f node: mm-mgr: Refactor to use logger parameter instead of context
This change completes the contextual logging migration for the memory
manager by updating the Manager interface and all implementations to
accept logr.Logger parameters instead of context.Context.

Key changes:
- Update Manager interface methods to accept logr.Logger:
  * AddContainer, RemoveContainer, GetMemoryNUMANodes
  * GetAllocatableMemory, GetMemory (removed context entirely)
- Update Policy interface methods to accept logr.Logger instead of context.Context
- Pass logger to NewManager() and policy constructors (NewPolicyStatic, NewPolicyNone, NewPolicyBestEffort)
- Update internal_container_lifecycle to use klog.TODO() when calling memory manager methods
- Update fake manager to accept and use logger parameter
- Update all test code to pass logger instead of context

This aligns with the contextual logging migration pattern where:
- Functions that need a logger accept logr.Logger parameter directly
- Logger is passed from the boundary (e.g., Start()) down to implementation
- klog.TODO() is used temporarily in call sites where logger is not yet available
- Context is only used where truly needed (e.g., Start() method)

This follows the same pattern as recent migrations in:
- pkg/kubelet/cm/topologymanager (#134174)
- pkg/kubelet/cm/devicemanager (#134293)
- pkg/kubelet/cm/cpumanager (#125912)

Related to the initial memory manager contextual logging work in #130727.

Signed-off-by: Swati Sehgal <swsehgal@redhat.com>
2025-10-29 16:09:42 +00:00
..
2025-10-24 20:04:20 +02:00
2025-10-20 18:52:54 +00:00
2025-10-10 23:51:05 +08:00