Skip to content

respect sort order for equal weight hooks #7416

Closed

Description

@dastrobu

Helm is currently sorting hooks by weight and then by name. This is nice, however, for hooks with equal weight I would expect that the same sorting by kind is done before executing the hooks with equal weight.
Consider e.g. the following example. A hook should run a job, but the job requires a certain service account to do that. So create a template with the service account and the jobs annotated as helm hook with some weight. Then it would make sense to sort the hooks by kind, like done for normal resources, to make sure that the service account is created before the job.
I think this would resource handling make more consistent, if it is done the same way for hooks and non-hooks.

To workaround this, one can manage the order by carefully choosing weights. For the example above that would mean that the service account must get a smaller weight than the job.

I am not sure if it is considered a feature or a bug, but I can provide a pull request to fix this, if the proposed solution is accepted.

Output of helm version:
version.BuildInfo{Version:"v3.0.2", GitCommit:"19e47ee3283ae98139d98460de796c1be1e3975f", GitTreeState:"clean", GoVersion:"go1.13.5"}

Activity

  1. added 2 commits that reference this issue on Jan 18, 2020
    121dd35
    9a2ff78
  2. added a commit that references this issue on May 8, 2020
    f68c282
  3. added a commit that references this issue on Oct 2, 2020
    1e65406
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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions