Skip to content

Commit

Permalink
Merge pull request #119 from XIAOMI-CloudNative/feat/show-nodename
Browse files Browse the repository at this point in the history
Fix pinger be removed by not found.
  • Loading branch information
seeker89 committed Apr 15, 2022
2 parents a461b0f + 72832bc commit 5cc9bd5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/goldpinger/updater.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ var checkResultsMux = sync.Mutex{}
// - there is already a pinger with the same name
// - the pinger has the same podIP
// - the pinger has the same hostIP
func exists(existingPods map[string]*GoldpingerPod, new *GoldpingerPod) bool {
old, exists := existingPods[new.Name]
func exists(existingPods map[string]*GoldpingerPod, podName string, new *GoldpingerPod) bool {
old, exists := existingPods[podName]
return exists && (old.PodIP == new.PodIP) && (old.HostIP == new.HostIP)
}

Expand All @@ -61,7 +61,7 @@ func updatePingers(resultsChan chan<- PingAllPodsResult) {

latest := SelectPods()
for podName, pod := range latest {
if exists(existingPods, pod) {
if exists(existingPods, podName, pod) {
// This pod continues to exist in the latest iteration of the update
// without any changes
// Delete it from the set of pods that we wish to delete
Expand Down

0 comments on commit 5cc9bd5

Please sign in to comment.