diff Framework/Plugins/DatabaseBackendAdapterV4.cpp @ 391:d14e6ff04a5c db-protobuf

added primitives to handle labels
author Sebastien Jodogne <s.jodogne@gmail.com>
date Wed, 05 Apr 2023 12:09:46 +0200
parents 3d6886f3e5b3
children 7b3acfa95bd8
line wrap: on
line diff
--- a/Framework/Plugins/DatabaseBackendAdapterV4.cpp	Wed Apr 05 11:18:08 2023 +0200
+++ b/Framework/Plugins/DatabaseBackendAdapterV4.cpp	Wed Apr 05 12:09:46 2023 +0200
@@ -567,9 +567,21 @@
 
     assert(values.size() == countValues);
 
+    std::set<std::string> withLabels, withoutLabels;
+
+    for (int i = 0; i < request.with_labels().size(); i++)
+    {
+      withLabels.insert(request.with_labels(i));
+    }
+
+    for (int i = 0; i < request.without_labels().size(); i++)
+    {
+      withoutLabels.insert(request.without_labels(i));
+    }
+    
     Output output(response);
     backend.LookupResources(output, manager, lookup, Convert(request.query_level()),
-                            request.limit(), request.retrieve_instances_ids());
+                            withLabels, withoutLabels, request.limit(), request.retrieve_instances_ids());
   }