On 10/4/21 10:42 PM, William Herrin wrote:
On Mon, Oct 4, 2021 at 6:15 PM Michael Thomas <mike@mtcc.com> wrote:
They have a monkey patch subsystem. Lol. Yes, actually, they do. They use Chef extensively to configure operating systems. Chef is written in Ruby. Ruby has something called Monkey Patches. This is where at an arbitrary location in the code you re-open an object defined elsewhere and change its methods.
Chef doesn't always do the right thing. You tell Chef to remove an RPM and it does. Even if it has to remove half the operating system to satisfy the dependencies. If you want it to do something reasonable, say throw an error because you didn't actually tell it to remove half the operating system, you have a choice: spin up a fork of chef with a couple patches to the chef-rpm interaction or just monkey-patch it in one of your chef recipes.
Just because a language allows monkey patching doesn't mean that you should use it. In that particular outage they said that they fix up errant looking config files rather than throw an error and make somebody fix it. That is an extremely bad practice and frankly looks like amateur hour to me. Mike