Skip to content

feat(hooks): Adds weighted hooks - #2157

Merged
technosophos merged 4 commits into
helm:masterfrom
jchauncey:hook-weights
Apr 3, 2017
Merged

technosophos merged 4 commits into
helm:masterfrom
jchauncey:hook-weights

Conversation

@jchauncey

Copy link
Copy Markdown

closes #2136

  • Adds new annotation helm.sh/hookWeight
  • Sorts executing hooks of similar kind in ascending order
  • There is no upper or lower bounds on the weights

Testing Steps:

  • Create a chart with at least 2 hooks (any type will work)
  • Weight each hook so that they execute in a predetermined order
  • Use a combination of positive and negative numbers.
  • It is also possible to not supply a weight and it will default to 0
  • Watch pod status to verify that pods come up in the correct order.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Mar 21, 2017
@technosophos
technosophos self-requested a review March 22, 2017 18:52
@technosophos technosophos added this to the 2.3.0 milestone Mar 22, 2017
@technosophos

Copy link
Copy Markdown
Member

This looks very straightforward to me. I think you said, @jchauncey, that you were fixing docs, too? Once that's done, I'll LGTM.

@technosophos

Copy link
Copy Markdown
Member

@jchauncey Can you try rebasing and then re-pushing? I think @adamreese 's change hasn't kicked in for this PR.

@jchauncey

Copy link
Copy Markdown
Author

@technosophos done

Jonathan Chauncey added 2 commits March 24, 2017 11:31
closes helm#2136
* Adds new annotation `helm.sh/hookWeight`
* Sorts executing hooks of similar kind in ascending order
* There is no upper or lower bounds on the weights
@thomastaylor312

thomastaylor312 commented Apr 1, 2017 •

Copy link
Copy Markdown
Contributor

@jchauncey Looks like there is a static validation test failure: pkg/tiller/hooks.go:114:3:warning: ineffectual assignment to hw (ineffassign). Could you address that and repush?

@unguiculus

Copy link
Copy Markdown
Member

Existing hooks use hyphens, not camel case (e. g. pre-install, post-delete). I'd suggest to name it hook-weight in order to be consistent.

@jchauncey

Copy link
Copy Markdown
Author

@thomastaylor312 updated pr. waiting on CI now

@thomastaylor312

Copy link
Copy Markdown
Contributor

@technosophos Is this good to go now?

@technosophos technosophos left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just that one small doc change, and this is ready to merge.

Comment thread docs/charts_hooks.md Outdated

```
annotations:
"helm.sh/hookWeight": "5"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this needs to be changed to hook-weight

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

Labels

awaiting review cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Proposal: Add a weight system to hooks

5 participants