예제 #1
0
func (o *OnDemandProbeClient) OnEdgeAdded(e *graph.Edge) {
	parent, child := o.graph.GetEdgeNodes(e)
	if parent == nil || child == nil || e.Metadata()["RelationType"] != "ownership" {
		return
	}

	o.onNodeEvent(child)
}
예제 #2
0
파일: tid.go 프로젝트: nplanel/skydive
// onEdgeEvent set TID for child TID nodes which is composed of the name
// the TID of the parent node and the type.
func (t *TIDMapper) onEdgeEvent(e *graph.Edge) {
	if e.Metadata()["RelationType"] != "ownership" {
		return
	}

	parent, child := t.Graph.GetEdgeNodes(e)
	if parent == nil {
		return
	}

	t.setTID(parent, child)
}
예제 #3
0
파일: fabric.go 프로젝트: nplanel/skydive
func (fb *FabricProbe) OnEdgeAdded(e *graph.Edge) {
	parent, child := fb.Graph.GetEdgeNodes(e)
	if parent == nil || child == nil || e.Metadata()["RelationType"] != "ownership" {
		return
	}

	if parent.Metadata()["Type"] == "host" {
		for node, link := range fb.links {
			if child.MatchMetadata(link.metadata) {
				if !fb.Graph.AreLinked(child, node) {
					fb.Graph.Link(node, child, graph.Metadata{"RelationType": "layer2", "Type": "fabric"})
				}
				delete(fb.links, node)
				break
			}
		}
	}
}