-
Notifications
You must be signed in to change notification settings - Fork 377
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
left-pad helm chart filenames with 0s to fix sorting #4106
left-pad helm chart filenames with 0s to fix sorting #4106
Conversation
I'm trying to work out how to add an auto test - is there a way to specify a config to be applied in CI? If so, I can just have two charts order |
Signed-off-by: Andrew Lavery <[email protected]>
23fd02e
to
380e32e
Compare
Thanks for looking into this. Can you provide an example of what you'd like to fix, so that we can cover this in an integration test? K0s does offer the order field on Helm extensions, but this may not work quite as expected. The file names control the order in which chart resources are applied to the cluster, but the actual installation happens when those resources are reconciled. Not sure if the order is guaranteed in any way on that end. Previous related PRs: |
Well, we've seen pretty consistent behavior where charts are initially applied in the order of their sorted filenames - and we recently merged a change to increase all 'order' values by 100 to allow orders 10-90 to work properly. (we also have a 'is this pod older than this other pod' check in CI now, to ensure that things are actually being applied in the right order) I'm not sure if the reconciliation order is guaranteed either, but I don't think we've seen it run outside of that order upon initial install yet! |
Let me get an example spec in a moment. |
(we had initially discovered this due to a demo helm chart with incorrect configuration that was applied before the ones we actually required, and never completed, blocking installation of the other charts until the timeout, and so I need to create a better example) |
The PR is marked as stale since no activity has been recorded in 30 days |
The PR is marked as stale since no activity has been recorded in 30 days |
Description
Fixes # (issue)
Currently, helm chart apply order is determined by sorting the helm chart manifest filenames. The order is included as the first element in the filename, resulting in names like
1_helm_extension_chartname.yaml
.Manifests are fetched here, which uses filepath.Glob, which calls sort on the results.
Unfortunately, this breaks at 10 -
10_helm_extension_anothername.yaml
is alphabetically before1_helm_extension_chartname.yaml
.This PR adds a fmt directive to left-pad these integers to 9 digits, which allows sorting to work properly - see https://go.dev/play/p/THZg3TD6eHI.
Type of change
How Has This Been Tested?
Checklist: