diff options
author | Lamont Granquist <lamont@scriptkiddie.org> | 2017-03-15 11:11:43 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-15 11:11:43 -0700 |
commit | 629b7b0864560b748508ab21d3472f532fe92cf3 (patch) | |
tree | 0eaa21b9239c15f3aed9bf9bc3a6068c9a13c865 | |
parent | 8530d59fc4fdf3f0afe44a968abf331741083986 (diff) | |
parent | 9d1b12a0df3769dfa2806a89f32cd0a27ce24d58 (diff) | |
download | chef-629b7b0864560b748508ab21d3472f532fe92cf3.tar.gz |
Merge pull request #5904 from chef/lcg/missing-relnotes
[ci skip] add missing relnotes for Node deep-duping
-rw-r--r-- | RELEASE_NOTES.md | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 7d5baaac2f..676b658068 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -65,3 +65,20 @@ Dropped the `create_if_missing` parameter that was immediately supplanted by the this) and converted the `created_at` parameter from an optional positional parameter to a named parameter. These changes are unlikely to affect any cookbook code. +### Node deep-duping fixes + +The `node.to_hash`/`node.to_h` and `node.dup` APIs have been fixed so that they correctly deep-dup the node data structure including every +string value. This results in a mutable copy of the immutable merged node structure. This is correct behavior, but is now more expensive +and may break some poor code (which would have been buggy and difficult to follow code with odd side effects before). + +For example: + +``` +node.default["foo"] = "fizz" +n = node.to_hash # or node.dup +n["foo"] << "buzz" +``` + +before this would have mutated the original string in-place so that `node["foo"]` and `node.default["foo"]` would have changed to "fizzbuzz" +while now they remain "fizz" and only the mutable `n["foo"]` copy is changed to "fizzbuzz". + |