Skip to content

Commit

Permalink
Use logrus instead of glog in service_control
Browse files Browse the repository at this point in the history
Signed-off-by: Pengyu Chen <[email protected]>
  • Loading branch information
Pengyu Chen committed Jun 25, 2018
1 parent 3d9afd1 commit 5615b9d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/control/service_control.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"fmt"
"sync"

"github.com/golang/glog"
log "github.com/sirupsen/logrus"
"k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/api/meta"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -108,10 +108,10 @@ func (r RealServiceControl) createServices(namespace string, service *v1.Service

accessor, err := meta.Accessor(object)
if err != nil {
glog.Errorf("parentObject does not have ObjectMeta, %v", err)
log.Errorf("parentObject does not have ObjectMeta, %v", err)
return nil
}
glog.V(4).Infof("Controller %v created service %v", accessor.GetName(), newService.Name)
log.Infof("Controller %v created service %v", accessor.GetName(), newService.Name)
r.Recorder.Eventf(object, v1.EventTypeNormal, SuccessfulCreateServiceReason, "Created service: %v", newService.Name)

return nil
Expand All @@ -123,7 +123,7 @@ func (r RealServiceControl) DeleteService(namespace, serviceID string, object ru
if err != nil {
return fmt.Errorf("object does not have ObjectMeta, %v", err)
}
glog.V(2).Infof("Controller %v deleting service %v/%v", accessor.GetName(), namespace, serviceID)
log.Infof("Controller %v deleting service %v/%v", accessor.GetName(), namespace, serviceID)
if err := r.KubeClient.CoreV1().Services(namespace).Delete(serviceID, nil); err != nil {
r.Recorder.Eventf(object, v1.EventTypeWarning, FailedDeleteServiceReason, "Error deleting: %v", err)
return fmt.Errorf("unable to delete service: %v", err)
Expand Down

0 comments on commit 5615b9d

Please sign in to comment.