Skip to content

Proposal: Add a weight system to hooks #2136

Closed

Description

@jchauncey

Scenario

I have two pre-upgrade hooks that I need to fire in a very particular order. As it is currently implemented the ordering is not guaranteed and my upgrade procedure may not complete.

Proposal

  • Add a weight to all hooks (supplied as an integer).
  • Tiller will pre-sort all hooks by weight in ascending order
  • Execute all hooks with the same weight simultaneously

This will allow users to supply their weights as a variable in the values.yaml file which can be overridden if a conflict arises. This also satisfies the need of allowing a specific execution order of hooks for complicated installation/upgrade processes.

Activity

  1. added this to the Upcoming - Minor milestone on Mar 17, 2017
  2. added
    help wanted
    and removed on Mar 17, 2017
  3. jchauncey commented on Mar 21, 2017

    @jchauncey
    Author

    So I have an implementation of this done.

    • Sorts hooks by weight and if there are any ties it will use the Name (hook.Name)
    • Does not execute hooks simultaneously (Im going to look into this but doesnt seem to be important)
    • Adds a new annotation helm.sh/hookWeight
  4. added 3 commits that reference this issue on Mar 21, 2017
    6eac582
    027baf4
    05d0fcb
  5. cheyang commented on Apr 9, 2018

    @cheyang

    I have two pre-upgrade hooks that I need to fire in a very particular order. As it is currently implemented the ordering is not guaranteed and my upgrade procedure may not complete.

    I'd like to ask how to determine the previous hook is completed, then start the second hook. If the previous hook is a pod, does the complete mean the pod is in ready status or just being loaded into kubernetes(maybe in pending).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    featurehelp wanted

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions