Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restore hook language removed by create/start split #532

Merged

Commits on Mar 3, 2017

  1. *: Restore hook lifecycle information removed by create/start split

    I expect the lifecycle information was removed accidentally in
    be59415 (Split create and start, 2016-04-01, opencontainers#384), because for a
    time it seemed like that PR would also be removing hooks.  Putting the
    lifecycle information back in, I made some tweaks to adjust to the new
    environment, for example:
    
    * Put the pre-start hooks after the 'start' call, but before the meat
      of the start call (the container-process exec trigger).  Folks who
      want a post-create hook can add one with that name.  I'd like to
      have renamed poststop to post-delete to avoid confusion like [1].
      But the motivation for keeping hooks was backwards compatibility [2]
      so I've left the name alone.
    
    * Put each "...command is invoked..." lifecycle entry in its own list
      entry, to match the 'create' list entry.
    
    * Move the rules about what happens on hook failure into the
      lifecycle.  This matches pre-split entries like:
    
        If any prestart hook fails, then the container MUST be stopped and
        the lifecycle continues at step 7.
    
      and avoids respecifying that information in a second location
      (config.md).
    
    * I added the warning section to try and follow post-split's generic
      "generates an error" approach while respecting the pre-split desire
      to see what failed (we had "then an error including the exit code
      and the stderr is returned to the caller" and "then an error is
      logged").
    
    * I left the state 'id' context out, since Michael didn't want it [3].
    
    * Make runtime.md references to "generate an error" and "log a
      warning" links, so readers have an easier time finding more detail
      on that wording.
    
    Where I reference a section, I'm still using the auto-generated anchor
    for that header and not the anchors which were added in 41839d7 (Merge
    pull request opencontainers#707 from mrunalp/anchor_tags, 2017-03-03) and similar.
    Mrunal suggested that the manually-added anchors were mainly intended
    for the validation tooling [4].
    
    [1]: opencontainers#395
         Subject: Run post-stop hooks before the container sandbox is deleted.
    [2]: opencontainers#483 (comment)
         Subject: *: Remove hooks
    [3]: opencontainers#532 (comment)
         Subject: Restore hook language removed by create/start split
    [4]: http://ircbot.wl.linuxfoundation.org/eavesdrop/%23opencontainers/%23opencontainers.2017-03-03.log.html#t2017-03-03T18:02:12
    
    Signed-off-by: W. Trevor King <wking@tremily.us>
    wking committed Mar 3, 2017
    Configuration menu
    Copy the full SHA
    f636808 View commit details
    Browse the repository at this point in the history