- From: Matthew Kent <
>
- To:
- Subject: [chef] Re: Re: Re: Re: Re: Re: Re: Re: deep merge - !merge users
- Date: Mon, 12 Dec 2011 15:25:00 -0800
<snip>
On Fri, Dec 9, 2011 at 9:24 AM, Daniel DeLeo
<
>
wrote:
<snip>
>
It's easy to imagine a case where you'd want to *subtract* values, say,
>
removing port 80 from an Array specifying which ports httpd should listen
>
on. And in fact, Chef's deep merging has some support for this, by
>
inserting special "!merge:" values in your attributes.
>
>
While one can imagine uses for this "subtractive merging," in practice no
>
one uses it, and simply by its existence, the computational and memory
>
requirements of the merging algorithm are increased substantially. This is
>
a big deal when you're, say, iterating over a large set of nodes returned
>
from a search result--a much more common use case.
>
>
The alternative existing mechanisms you could use to subtract values from
>
attributes (modify the cookbook, use a "proxy" cookbook to forcibly set the
>
attributes correctly) aren't very pretty either, but I think they'd at
>
least lead you to a more declarative result, and be easier for everyone on
>
your team to follow.
Thanks for this summary and positioning statement - sounds like
there's not much interesting in merging CHEF-2737 so I've closed it
for now.
I'll file another ticket for cleaning up the existing 0.10 role
!merge: behaviour and I'll update the deep merge doc for
clarification.
I'm guessing in 0.11 you'd like the !merge subtraction removed
entirely? Only so I can mention this in the code/docs as well.
Certainly would reduce the code gymnastics in the deep merge mixin and
specs...
--
Matthew Kent |
http://magoazul.com
Archive powered by MHonArc 2.6.16.