skydive icon indicating copy to clipboard operation
skydive copied to clipboard

OVN is not a supported type(map[string]interface {}

Open lebauce opened this issue 4 years ago • 9 comments

lebauce avatar Nov 12 '20 10:11 lebauce

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

amorenoz avatar Nov 12 '20 11:11 amorenoz

@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 Priority Metadata 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 avatar Nov 13 '20 07:11 amorenoz

@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 avatar Nov 13 '20 09:11 lebauce

@lebauce Yes. Your patch seems to fix the problem. Many thanks!

amorenoz avatar Nov 17 '20 11:11 amorenoz

@lebauce, should your patch allow MetadataIndexing inside the ACLMetadata fields? something like: exampleIndexer := graph.NewMetadataIndexer(g, p.aclIndexer, nil, "OVN.Direction")

amorenoz avatar Nov 19 '20 11:11 amorenoz

That's supposed to work, isn't it ?

lebauce avatar Nov 22 '20 21:11 lebauce

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.

amorenoz avatar Nov 23 '20 08:11 amorenoz

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 avatar Nov 24 '20 12:11 lebauce

@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

amorenoz avatar Nov 25 '20 08:11 amorenoz