Project

General

Profile

Bug #11703

Node properties local override does not function as one would expect

Added by Nicolas CHARLES about 1 month ago. Updated 14 days ago.

Status:
Released
Priority:
N/A
Category:
Initial promises & sys tech
Target version:
Target version (plugin):
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Pull Request:
Priority:
76

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"
},
}
}


Related issues

Related to Rudder - User story #11618: Node properties local override Released

History

#1 Updated by Nicolas CHARLES about 1 month ago

#2 Updated by Benoît PECCATTE 28 days 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

#3 Updated by Benoît PECCATTE 28 days 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.

#4 Updated by François ARMAND 14 days 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

#5 Updated by François ARMAND 14 days ago

  • Status changed from Pending technical review to Released
  • Assignee set to Nicolas CHARLES

Also available in: Atom PDF