Skip to content

Commit 60fcc5c

Browse files
fix: [NPM-WIN] ability to reassign Pod associated with Endpoint (#1806)
* reset acls for pods marked for delete * simplify: remove stalePodKey * add log for associating pod with endpoint * reorganize win dp uts * UTs for issue 1729 (fail because podMarkedForDelete is not used) * update controller mock to use deleted pod metadata * rename podMarkedForDelete to deletedPod * all UTs (noticing edge in ipsetmanager now) * updatePod() works for all sequences * work with updatePodCache and existing controlplane * remove pod delete logic * remove change incorrect comment * fix lint * fix gofumpt * remove changes to dp.go logs/comments
1 parent 81537f3 commit 60fcc5c

File tree

6 files changed

+1184
-75
lines changed

6 files changed

+1184
-75
lines changed

npm/pkg/controlplane/controllers/v2/podController.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -455,8 +455,7 @@ func (c *PodController) syncAddAndUpdatePod(newPodObj *corev1.Pod) (metrics.Oper
455455
addToIPSets, deleteFromIPSets := util.GetIPSetListCompareLabels(cachedNpmPod.Labels, newPodObj.Labels)
456456

457457
newPodMetadata := dataplane.NewPodMetadata(podKey, newPodObj.Status.PodIP, newPodObj.Spec.NodeName)
458-
// todo: verify pulling nodename from newpod,
459-
// if a pod is getting deleted, we do not have to cleanup policies, so it is okay to pass in wrong nodename
458+
// should have newPodMetadata == cachedPodMetadata since from branch above, we have cachedNpmPod.PodIP == newPodObj.Status.PodIP
460459
cachedPodMetadata := dataplane.NewPodMetadata(podKey, cachedNpmPod.PodIP, newPodMetadata.NodeName)
461460
// Delete the pod from its label's ipset.
462461
for _, removeIPSetName := range deleteFromIPSets {

0 commit comments

Comments
 (0)