Skip to content

Commit

Permalink
fix: ignore delete pod cache error msg (#714)
Browse files Browse the repository at this point in the history
  • Loading branch information
Donghui0 authored Oct 20, 2021
1 parent fa27b03 commit 97fdc90
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pkg/types/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (p *podCache) Add(pod *corev1.Pod) error {
func (p *podCache) Delete(pod *corev1.Pod) error {
ip := pod.Status.PodIP
if len(ip) == 0 {
return ErrPodNoAssignedIP
return nil
}
p.Lock()
defer p.Unlock()
Expand Down
2 changes: 1 addition & 1 deletion pkg/types/pod_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func TestPodCacheBadCases(t *testing.T) {
},
}
assert.Equal(t, pc.Add(pod1), ErrPodNoAssignedIP, "adding pod")
assert.Equal(t, pc.Delete(pod1), ErrPodNoAssignedIP, "deleting pod")
assert.Equal(t, pc.Delete(pod1), nil, "deleting pod")
}

func TestPodCache(t *testing.T) {
Expand Down

0 comments on commit 97fdc90

Please sign in to comment.