Project

General

Profile

Actions

Bug #11703

closed

Node properties local override does not function as one would expect

Added by Nicolas CHARLES about 7 years ago. Updated almost 7 years ago.

Status:
Released
Priority:
N/A
Category:
System techniques
Target version:
Severity:
Critical - prevents main use of Rudder | no workaround | data loss | security
UX impact:
User visibility:
Operational - other Techniques | Technique editor | Rudder settings
Effort required:
Priority:
76
Name check:
Fix check:
Regression:

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 1 (0 open1 closed)

Related to Rudder - User story #11618: Node properties local overrideReleasedAlexis MoussetActions
Actions #1

Updated by Nicolas CHARLES about 7 years ago

Actions #2

Updated by Benoît PECCATTE about 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
Actions #3

Updated by Benoît PECCATTE about 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.

Actions #4

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

Actions #5

Updated by François ARMAND almost 7 years ago

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

Also available in: Atom PDF