Skip to content

Commit

Permalink
fix: check allocated annotation in update handler
Browse files Browse the repository at this point in the history
A temporary workaround, refactor the annotation usage later

(cherry picked from commit eb63f72)
  • Loading branch information
oilbeater committed Nov 2, 2021
1 parent 79be0cd commit 4531612
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -664,6 +664,11 @@ func (c *Controller) handleUpdatePod(key string) error {
return err
}

// in case update handler overlap the annotation when cache is not in sync
if pod.Annotations[util.AllocatedAnnotation] == "" {
return fmt.Errorf("no address has been allocated to %s/%s", namespace, name)
}

klog.Infof("update pod %s/%s", namespace, name)

var podIP string
Expand Down

0 comments on commit 4531612

Please sign in to comment.