Skip to content

Commit

Permalink
fix pod has no ip
Browse files Browse the repository at this point in the history
  • Loading branch information
halfcrazy committed Apr 10, 2019
1 parent cb41585 commit 049cab2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/controller/pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ func (c *Controller) enqueueDeletePod(obj interface{}) {
func (c *Controller) enqueueUpdatePod(oldObj, newObj interface{}) {
oldPod := oldObj.(*v1.Pod)
newPod := newObj.(*v1.Pod)
// assigned to a node
if oldPod.Spec.NodeName == "" && newPod.Spec.NodeName != "" {
// pod assigned an ip
if oldPod.Status.PodIP == "" && newPod.Status.PodIP != "" {
var key string
var err error
if key, err = cache.MetaNamespaceKeyFunc(newObj); err != nil {
Expand Down

0 comments on commit 049cab2

Please sign in to comment.