[chef] The dangers of prepend


Chronological Thread 
  • From: Yoshi Spendiff < >
  • To: chef < >
  • Subject: [chef] The dangers of prepend
  • Date: Tue, 25 Aug 2015 11:11:30 -0700

Hi,

As an FYI to anyone that uses the varnish cookbook >= 2.0.0, an update was just released (2.2.1) that fixes a bug in the service resource and is probably worth updating to sooner rather than later.

One of the libraries in the varnish cookbook used a prepend statement to altered the behaviour of the Provider::Service::Init and Provider::Service::Systemd classes, resulting in service resource declarations attempting starts/restarts 5 times and failing silently. Because it was in a loaded library simply including the cookbook in a dependency chain would cause this.
This was a bug (it was only supposed to affect services of a certain name) but I think it's a pretty clear demonstration of the dangers of using prepend on core Chef libraries.

Perhaps some sort of a warning should be issue if a prepend is used, as the user may be signing up for something they aren't aware of.

--
Yoshi Spendiff
Ops Engineer
Indochino
Mobile: +1 778 952 2025



Archive powered by MHonArc 2.6.16.

§