Skip to content

Commit

Permalink
Merge pull request #320 from caseydavenport/cherry-pick
Browse files Browse the repository at this point in the history
[release-v3.2] Cherry pick log change
  • Loading branch information
caseydavenport authored Nov 9, 2018
2 parents 356b169 + 10f87fd commit e83f68b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
8 changes: 3 additions & 5 deletions pkg/controllers/pod/pod_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ func NewPodController(ctx context.Context, k8sClientset *kubernetes.Clientset, c

wepInterface, err := podConverter.Convert(obj)
if err != nil {
log.WithError(err).Errorf("Error while converting %#v to wep.", obj)
log.WithError(err).Errorf("Error while converting %v to wep.", key)
return
}

Expand All @@ -134,8 +134,6 @@ func NewPodController(ctx context.Context, k8sClientset *kubernetes.Clientset, c
return
}
log.Debugf("Got UPDATE event for pod: %s", key)
log.Debugf("Old object: \n%#v\n", oldObj)
log.Debugf("New object: \n%#v\n", newObj)

// Ignore updates for not ready / irrelevant pods.
if !isReadyCalicoPod(newObj.(*v1.Pod)) {
Expand All @@ -145,7 +143,7 @@ func NewPodController(ctx context.Context, k8sClientset *kubernetes.Clientset, c

wepInterface, err := podConverter.Convert(newObj)
if err != nil {
log.WithError(err).Errorf("Error while converting %#v to wep.", newObj)
log.WithError(err).Errorf("Error while converting %v to wep.", key)
return
}

Expand All @@ -170,7 +168,7 @@ func NewPodController(ctx context.Context, k8sClientset *kubernetes.Clientset, c

wepInterface, err := podConverter.Convert(obj)
if err != nil {
log.WithError(err).Errorf("Error while converting %#v to wep.", obj)
log.WithError(err).Errorf("Error while converting %v to wep.", key)
return
}

Expand Down
5 changes: 3 additions & 2 deletions pkg/converter/pod_converter.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
package converter

import (
"errors"
"fmt"

log "github.com/sirupsen/logrus"
Expand Down Expand Up @@ -68,11 +69,11 @@ func (p *podConverter) Convert(k8sObj interface{}) (interface{}, error) {
if !ok {
tombstone, ok := k8sObj.(cache.DeletedFinalStateUnknown)
if !ok {
return nil, fmt.Errorf("couldn't get object from tombstone %+v", k8sObj)
return nil, errors.New("couldn't get object from tombstone")
}
pod, ok = tombstone.Obj.(*v1.Pod)
if !ok {
return nil, fmt.Errorf("tombstone contained object that is not a Pod %+v", k8sObj)
return nil, errors.New("tombstone contained object that is not a Pod")
}
}

Expand Down

0 comments on commit e83f68b

Please sign in to comment.