mirror of https://github.com/k3s-io/k3s
add Stringer interface for eventType
parent
58d2d9ade1
commit
3329446c0e
|
@ -38,6 +38,19 @@ import (
|
|||
|
||||
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 (
|
||||
addEvent eventType = iota
|
||||
updateEvent
|
||||
|
@ -427,7 +440,7 @@ func (gb *GraphBuilder) processGraphChanges() bool {
|
|||
utilruntime.HandleError(fmt.Errorf("cannot access obj: %v", err))
|
||||
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
|
||||
existingNode, found := gb.uidToNode.Read(accessor.GetUID())
|
||||
switch {
|
||||
|
|
Loading…
Reference in New Issue