Comment 4 for bug 1672436

Revision history for this message
Barry Warsaw (barry) wrote : Re: [Bug 1672436] Re: Add an official hook API

On Mar 15, 2017, at 07:22 PM, Steve Langasek wrote:

>There are not many files on the filesystem in the ubuntu-core case, period;
>the only one we've needed to delete, so far, is one that snap prepare-image
>will soon stop writing, once cloud-init's ds-identify support has landed. I
>don't think we should expect this to be an ongoing production use case for a
>hook.

The question then is whether we want a general hook which can be used for
whatever purpose, or a configuration file which describes which files to add
if that's the only use case we think we're ever going to need.

I'm still inclined to provide a more general programmatic hook that can be
used for any purpose. It actually makes ubuntu-image simpler that way too,
because we just need to find the place to add that hook, and then define how
it's used (e.g. can it be a Python callable, or should it be a more generic
subprocess call so the hook can be in any language).

The more limited mechanism means we need to define a format (YAML,
line-oriented text file, etc.), a parser, and the machinery to do the copies,
all of which must be tested and documented. A general hook gives users more
flexibility, and is simpler to code, test, and document in u-i.