skydive
skydive copied to clipboard
OVN is not a supported type(map[string]interface {}
This issue may be the reason why I'm failing to create a MetadataIndexer on an OVN field. Well, it's being created but no events get generated and all the calls to GetNode() return nil
@lebauce , I think this bug also causes the gremlin API to be unable to filter based on OVN Metadata. I have done the following experiment:
- Modified aclMetadata to add the
PriorityMetadata Field in the root Metadata object, so it reads:
func (p *Probe) aclMetadata(acl *goovn.ACL) graph.Metadata {
return graph.Metadata{
"Type": "acl",
"Name": acl.UUID,
"Manager": "ovn",
"Priority": int64(acl.Priority),
"OVN": Metadata{
ACLMetadata: ACLMetadata{
Action: acl.Action,
Direction: acl.Direction,
Log: acl.Log,
Match: acl.Match,
Priority: int64(acl.Priority),
},
ExtID: graph.NormalizeValue(acl.ExternalID).(map[string]interface{}),
},
}
}
- Filtering by the "internal" field fails, while the "root" one works:
$ ./skydive client query "G.V().Has('Type', 'acl').Has('Priority', 1001).Count()"
3
$ ./skydive client query "G.V().Has('Type', 'acl').Has('OVN.Priority', 1001).Count()"
0
@amorenoz The ACL metadata was not properly initialized. I just pushed this fix https://github.com/skydive-project/skydive/pull/2282, could you please give it a try ? Thanks !
@lebauce Yes. Your patch seems to fix the problem. Many thanks!
@lebauce, should your patch allow MetadataIndexing inside the ACLMetadata fields? something like:
exampleIndexer := graph.NewMetadataIndexer(g, p.aclIndexer, nil, "OVN.Direction")
That's supposed to work, isn't it ?
It wasn't in some tests I was running. But maybe my problem was due to something else. Let me write up a small patch to test it and get back to you.
I see in your commit, you do (https://github.com/amorenoz/skydive/commit/9ae48d1b8422228629e36a0b76f1f4168ffe4565#diff-99dccec1382a2bc49bf3e91c74ac6766c2441bd18d4232ffc46e908e3b674b98R612):
LFMetadata: LFMetadata{
for the indexer to work, you need to do :
LFMetadata: &LFMetadata{
Same for DPBMetadata: DPBMetadata{
@lebauce you mean the same you did with the ACL metadata?
"OVN": Metadata {
to
"OVN": &Metadata {
I already did that.
I don't see how I could assign an object of type * LFMetadata to a field of type LFMetadata