Commit Graph

6 Commits

Author SHA1 Message Date
Kubernetes Prow Robot 9220470d9f
Merge pull request #8188 from towca/jtuznik/tni-fix
CA: stop mutating the result of .TemplateNodeInfo() in SanitizedTemplateNodeInfoFromNodeGroup
2025-06-04 09:20:38 -07:00
Kuba Tużnik 2f6c19a171 CA: stop mutating the result of .TemplateNodeInfo() in SanitizedTemplateNodeInfoFromNodeGroup
SanitizedTemplateNodeInfoFromNodeGroup() calls .TemplateNodeInfo(),
adds deprecated labels to the result, then sanitizes it - which includes
deep-copying.

This commit moves adding the deprecated labels after the sanitization
process, directly to the deep-copied result.

If .TemplateNodeInfo() caches its result internally, and is called
from a CloudProvider-specific goroutine at the same time as
SanitizedTemplateNodeInfoFromNodeGroup(), CA panics because of a
concurrent map read/write. This change removes the race condition.
2025-06-04 14:46:16 +02:00
Omer Aplatony bcf3866fb8 migrate ClaimOwningPod to use upstream IsForPod
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
2025-06-03 15:45:20 +00:00
mendelski 68c7d1a84e
Force preempting system-node-critical daemon sets 2025-02-17 18:10:27 +00:00
Kuba Tużnik 4e68a0c6ef CA: sanitize and propagate DRA objects through NodeInfos in node_info utils 2024-12-20 13:30:36 +01:00
Kuba Tużnik eb26816ce9 CA: refactor utils related to NodeInfos
simulator.BuildNodeInfoForNode, core_utils.GetNodeInfoFromTemplate,
and scheduler_utils.DeepCopyTemplateNode all had very similar logic
for sanitizing and copying NodeInfos. They're all consolidated to
one file in simulator, sharing common logic.

DeepCopyNodeInfo is changed to be a framework.NodeInfo method.

MixedTemplateNodeInfoProvider now correctly uses ClusterSnapshot to
correlate Nodes to scheduled pods, instead of using a live Pod lister.
This means that the snapshot now has to be properly initialized in a
bunch of tests.
2024-11-27 12:51:30 +01:00