Bug #11703
closedNode properties local override does not function as one would expect
Description
Local override works more like a replacement than a merge, which makes it quite unexpected
If we have local node properties json file with:
{
"properties":{
"property_key1":"local node prop",
"property_key2":{
"more":"local node prop",
"and":"local node prop",
},
}
}
The agent then load node properties from /var/rudder/cfengine-community/inputs/properties.d/ and from /var/rudder/local/properties.d/, and merge them at the "properties"'s children level with local properties winning;
So if Rudder properties was:
{
"properties":{
"property_key0":"from rudder",
"property_key1":{
"key1":"from rudder",
"key2":"from rudder also"
},
"property_key2":{
"key1":"from rudder",
"key2":"from rudder also"
},
}
}
The results is:
{
"properties":{
"property_key0":"from rudder",
"property_key1":"local node prop",
"property_key2":{
"more":"local node prop",
"and":"local node prop"
},
}
}
but what we really expect is:
{
"properties":{
"property_key0":"from rudder",
"property_key1":"local node prop",
"property_key2":{
"key1":"from rudder",
"key2":"from rudder also",
"more":"local node prop",
"and":"local node prop"
},
}
}
Updated by Nicolas CHARLES almost 7 years ago
- Related to User story #11618: Node properties local override added
Updated by Benoît PECCATTE almost 7 years ago
- User visibility changed from Infrequent - complex configurations | third party integrations to Operational - other Techniques | Technique editor | Rudder settings
- Priority changed from 65 to 76
Updated by Benoît PECCATTE almost 7 years ago
We should document that this feature is an "override" not a merge.
We may need an additional feature that can "patch" an existing property.
This is a different feature that can be hard to implement and to understand as a user.
To completely control how you merge something, you should call the generic method to merge a variable (variable_dict_merge_tolerant) by yourself.
Updated by François ARMAND almost 7 years ago
- Status changed from New to Pending technical review
This is now correctly documented, both the behavior and the workaround for merging: https://www.rudder-project.org/doc-4.1/_node_properties.html#_local_override
Updated by François ARMAND almost 7 years ago
- Status changed from Pending technical review to Released
- Assignee set to Nicolas CHARLES