For ADDED, we broadcast directly after receiving the pod info and successfully processing it for the first time from the API server, so this should always be the first thing broadcast for a given pod.
For DELETED, we broadcast after it has been processed in updateStatusInternal with podIsFinished, so this should always be the last thing broadcast for a given pod.
For MODIFIED, we broadcast once when we receive a new spec from the API server, and once when we finish processing in the status manager. This way the watchers can see the flow from when a spec is received to when it has reconciled. To avoid status flapping on slow status updates with many spec updates, we always overlay the latest status from the status manager on every broadcast. This hybrid state is fine because the ObservedGeneration will indicate how far desynced the spec has become from the status, so watchers can act accordingly.
- Fixed version in kube_features.go after rebase (1.35->1.36)
- Removed internal pod cache in PodsServer to reduce memory footprint and avoid duplication.
- Injected pod.Manager into PodsServer to serve as the single source of truth for pod data.
- Refactored WatchPods to broadcast UIDs and fetch fresh pod data from podManager, ensuring consistency.
- Updated convertWatchEventType to safely handle unknown event types.
- Refactored unit tests to use MockManager and added a test case for static pods.
- Updated e2e suite with static pod test
The tiered approach uses memory.min for Guaranteed pods (hard protection)
and memory.low for Burstable pods (soft protection). Rename the policy
value to reflect this design.
This patch replaces direct struct initialization cpuset.CPUSet{} with
cpuset.New() to ensure the internal map is properly initialized.
While most CPUSet methods work correctly without this change, the Equals
method uses reflect.DeepEqual which returns false when comparing CPUSet
instances where one has a nil internal map and the other has an initialized
(empty) map. This can lead to unexpected false negatives in equality checks.
For example, the following comparison would incorrectly return false:
cpuset.CPUSet{}.Equals(cpuset.New())
This change ensures consistent behavior across all CPUSet operations.
Signed-off-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
consolidate the pattern
```
pod = e2epod.NewPodClient(f).CreateSync(ctx, pod)
podMap[string(pod.UID)] = pod
```
into a new helper function. More than reducing code duplication,
this is to avoid bugs and leaks.
Signed-off-by: Francesco Romani <fromani@redhat.com>
we get flakes on CI, not on dev environments, which
suggests a timing issue. From test perspective,
there is no need of immediate response, so adding
an Eventually doesn't invalidate the test and should reduce flakes.
Signed-off-by: Francesco Romani <fromani@redhat.com>
move generic helpers in the generic utilities file,
because this code is not topology-manager specific and we
lack a better place.
trivial code movement.
Signed-off-by: Francesco Romani <fromani@redhat.com>