Custom node properties from inventory are not found in group search
In a node web-page, in the properties tab, or in the group creation page, queries can be done on node properties.
When the properties source is the inventory, they are loaded on the interface but do not appear in the query answer.
Query are functional after entering manually a "classic" node property (key/value from the same web page).
#1 Updated by Benoît PECCATTE 7 months ago
- Category set to Web - UI & UX
- Target version set to 410
- Severity set to Critical - prevents main use of Rudder | no workaround | data loss | security
- User visibility set to Operational - other Techniques | Technique editor | Rudder settings
- Priority changed from 0 to 76
#5 Updated by François ARMAND 6 months ago
So, what is happening is:
- when the value comes from inventory, we only have it in inventory LDAP branch ("ou=Accepted Node, ou=inventories, etc).
- the search for group does not look at that place, so it is "normal" to not find it with that search,
- the quicksearch does look at that place and find it,
BUT when we add a proprety, "inventory", it copy all properties to node, making it searchable.
Moreover, it seems that only the last inventory property is added.
#7 Updated by François ARMAND 6 months ago
Work in progess here: https://github.com/fanf/rudder/commit/766b309930b9519b016da49e5a137a9b7bdc8492
#8 Updated by François ARMAND 6 months ago
So, the copy bug was hidding the fact that the search is just plain missing on custom node properties from inventory.
So, the idea is to rework a little the way our search works to cleanly split search on node info apport from the one on inventories properties. It was not working eleganlty for NodeState in all case.
Basically, it means that each Criterion in DIT will be either an LDAP criterion (everything until now is such an LDAP criterion) or it will be a "node info criterion" (basically, a NodeInfo => Value => Boolean).
Then, we just post process these element correctly. We are already relying on NodeInfoService for that, we just have to extends a little the "getLDAPNodeInfo" method.
Finally, it will open-up the real of REAL JSON query (because, on node info, node properties are parsed JSON).
Everything works for NodeState, now we need to build a NodeCriterion for NodeProperties and use it.
#9 Updated by François ARMAND 6 months ago
- Status changed from In progress to Pending technical review
- Assignee changed from François ARMAND to Vincent MEMBRÉ
- Pull Request set to https://github.com/Normation/rudder/pull/1960
- Priority changed from 76 to 75