Skip to content

fix(helm): sort hooks by kind for equal weight - #7432

Closed
dastrobu wants to merge 1 commit into
helm:masterfrom
dastrobu:7416-respect-sort-order-for-equal-weight-hooks
Closed

dastrobu wants to merge 1 commit into
helm:masterfrom
dastrobu:7416-respect-sort-order-for-equal-weight-hooks

Conversation

@dastrobu

Copy link
Copy Markdown
Contributor

Use the same install order for hooks as for normal resources (non-hooks) for hooks with equal weight.
This makes resource handling more consistent and helps, when there are hook consisting of several resources like e.g. a service account and a job using this service account.

The sort functions are changed from an in place search to an out of place sort to avoid inout parameters.

Closes #7416.

Signed-off-by: Daniel Strobusch [email protected]

@helm-bot helm-bot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 18, 2020
@mattfarina

Copy link
Copy Markdown
Collaborator

@dastrobu Thanks for the PR. CI found issues with the formatting of the code change. Can you please fix it.

Use the same install order for hooks as for normal resources (non-hooks) for hooks with equal weight.
This makes resource handling more consistent and helps, when there are hook consisting of several resources like e.g. a service account and a job using this service account.

The sort functions are changed from an in place search to an out of place sort to avoid inout parameters.

Closes helm#7416.

Signed-off-by: Daniel Strobusch <[email protected]>
@dastrobu
dastrobu force-pushed the 7416-respect-sort-order-for-equal-weight-hooks branch from 121dd35 to 9a2ff78 Compare January 23, 2020 08:08
@dastrobu

Copy link
Copy Markdown
Contributor Author

@mattfarina fixed it (I will look at the build myself next time).

@bacongobbler bacongobbler added this to the 3.1.0 milestone Jan 27, 2020
@bacongobbler

Copy link
Copy Markdown
Member

Thanks for working on this @dastrobu. After reviewing this with @mattfarina, we found some cases where we could improve the code to prevent extra memory allocations. Specifically, sortManifestsByKind did not need to be an out-of-place sort. Since Go passed manifests by value, the original order was preserved. I also took the time to DRY up some of the code.

Have a look at #7499 for the successor to this PR.

Thanks!

@dastrobu
dastrobu deleted the 7416-respect-sort-order-for-equal-weight-hooks branch March 11, 2020 08:04
dastrobu added a commit to dastrobu/helm-www that referenced this pull request Jun 25, 2020
dastrobu added a commit to dastrobu/helm-www that referenced this pull request Jul 1, 2020
flynnduism pushed a commit to flynnduism/helm-www that referenced this pull request Aug 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/L Denotes a PR that changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

respect sort order for equal weight hooks

4 participants