Commit 3329446c authored by Wei Wei's avatar Wei Wei

add Stringer interface for eventType

parent 58d2d9ad
...@@ -38,6 +38,19 @@ import ( ...@@ -38,6 +38,19 @@ import (
type eventType int type eventType int
func (e eventType) String() string {
switch e {
case addEvent:
return "add"
case updateEvent:
return "update"
case deleteEvent:
return "delete"
default:
return fmt.Sprintf("unknown(%d)", int(e))
}
}
const ( const (
addEvent eventType = iota addEvent eventType = iota
updateEvent updateEvent
...@@ -427,7 +440,7 @@ func (gb *GraphBuilder) processGraphChanges() bool { ...@@ -427,7 +440,7 @@ func (gb *GraphBuilder) processGraphChanges() bool {
utilruntime.HandleError(fmt.Errorf("cannot access obj: %v", err)) utilruntime.HandleError(fmt.Errorf("cannot access obj: %v", err))
return true return true
} }
glog.V(5).Infof("GraphBuilder process object: %s/%s, namespace %s, name %s, event type %s", typeAccessor.GetAPIVersion(), typeAccessor.GetKind(), accessor.GetNamespace(), accessor.GetName(), event.eventType) glog.V(5).Infof("GraphBuilder process object: %s/%s, namespace %s, name %s, event type %v", typeAccessor.GetAPIVersion(), typeAccessor.GetKind(), accessor.GetNamespace(), accessor.GetName(), event.eventType)
// Check if the node already exsits // Check if the node already exsits
existingNode, found := gb.uidToNode.Read(accessor.GetUID()) existingNode, found := gb.uidToNode.Read(accessor.GetUID())
switch { switch {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment