First customer pain point pull request - default-hook

Gustavo Niemeyer gustavo at niemeyer.net
Wed Aug 20 18:58:03 UTC 2014


On Wed, Aug 20, 2014 at 3:45 PM, Nate Finch <nate.finch at canonical.com> wrote:
> Here's a proposal that is much simpler: we add a flag to the charm metadata,
> called something like "single_hook".  When single_hook is true, all hook
> events run a file called "default-hook" (or whatever we want to call it, I
> don't really care).  $JUJU_HOOK_NAME will be set with the name of the hook
> that is running.  That's it.  What the charm authors do after the hook file
> gets run is up to them.

That sounds reasonable. We could make both the hook name and the charm
metadata flag be "single-hook".

But does it solve people's problems?  Would people that today use half
of the hooks symlinked and half of them without symlinks transition to
that model, or is symlinking more convenient?  What about people using
charm helpers without a dispatch table, such as the case Aaron raised
in this thread?  Their charms would be broken (or will eventually be
broken) without a dispatch table. Would they transition or would they
stick to current practices?

> In the bug's comments, there's discussion about a lack of discoverability
> for what hooks the charm has... but honestly, if you need to know what the
> hooks do, you have to read the code anyway. Hopefully knowing what hooks a
> charm has shouldn't be necessary to use the charm (if using Juju requires
> you to read a charm's code... we're doing something wrong).

We're also doing something wrong if knowing what a hook is supposed to
do requires reading the code.


gustavo @ http://niemeyer.net



More information about the Juju-dev mailing list