Repository navigation
Fixes #3338: Implement "atomic" upgrade/install - #5143
Conversation
|
@cleac Thanks for this PR! I hadn't followed along with the original issue and it is a holiday in the US this coming Monday, so give me a bit to go through this and review. I'll review the code right now and then do more testing with it to make sure it is good to go |
There was a problem hiding this comment.
This is looking great. Just a few small fixes and if you could add some simple unit tests for the flag in install_test.go and upgrade_test.go while you are there, that would be great!
I'll be doing some manual validation of this as well in the meantime
|
Just a note that I relabeled this a feature to match the issue it is closing. Although the current behavior is clunky/painful, it isn't a bug. So this will be a nice add! |
|
Ok, so it is looking like things are working after I tested. My only suggestion would be to print something when the purge is successful on install. Right now I get the friendly message of |
|
@cleac Looks like the build failed due to docs |
Add possibility to put "--safe" argument to install and upgrade command that restores the state of cluster in case of failed install/upgrade attempt Signed-off-by: Alexander Nesterenko <[email protected]>
Signed-off-by: Alexander Nesterenko <[email protected]>
…nding, what it does Signed-off-by: Alexander Nesterenko <[email protected]>
Signed-off-by: Alexander Nesterenko <[email protected]>
thomastaylor312
left a comment
There was a problem hiding this comment.
One small change on the documentation for each command and then this should be good to go! Thanks for all the work on it
Signed-off-by: Alexander Nesterenko <[email protected]>
|
Thanks for all the work on this @cleac! |
|
@thomastaylor312 @technosophos thanks much for review ^_^ |
|
/cc @nce @thomastaylor312 @technosophos does this fix #1193 ? |
|
@jkroepke I think it helps work around it based on what I am reading, but I don't know if it fully solves the issue |
| timeout: u.timeout, | ||
| wait: u.wait, | ||
| description: "", | ||
| revision: releaseHistory.Releases[0].Version, |
There was a problem hiding this comment.
How will this work if helm upgrade --install --atomic is used and there is no previous release? Doesn't it need to purge like the install command in that case?
There was a problem hiding this comment.
Erm... If the --install is passed and there are no previous versions, it invokes helm install ... command, while all the parameters are passed to it. You are looking at pretty different place 😄
|
/cc @nce @thomastaylor312 @technosophos One more. Is this a workaround for #4871, too? It would be pretty awesome since it breaks the CI, too. |
|
@jkroepke No it does not solve the case, which is described in the PR #4871. 4871 is about a bug inside of the install/upgrade operation internals. This operation can break own invariant, which is a bad thing. This pr 5143 is about automatically running rollback operation (which is the same install/upgrade operation, but reversed), but it does not change the internals of this operation. Read details and code in the #4871. |
bacongobbler
left a comment
There was a problem hiding this comment.
While the majority of the PR looks good here, I think there are several questionable design flaws that need to be addressed, namely how the --atomic flag chooses the release it needs to roll back to as well as the inclusion of enabling the --wait flag. I'll follow up with a PR.
See #5377 for some early feedback on this issue as well.
| timeout: u.timeout, | ||
| wait: u.wait, | ||
| description: "", | ||
| revision: releaseHistory.Releases[0].Version, |
There was a problem hiding this comment.
Why are we relying on the latest release version here? The latest released version is not always the version that was last deployed and in a healthy state. We need to roll back to the last good state we were in prior to the upgrade.
There was a problem hiding this comment.
For those landing here, @bacongobbler is working to address this case in this PR
|
After taking a good look at the code, I can see why it doesn't address @distorhead's issues as well: it's not a truly atomic rollback; it just calls @distorhead if you want to roll your changes into the |
Fixes helm#3338: Implement "atomic" upgrade/install Signed-off-by: Kevin Labesse <[email protected]>
@bacongobbler Sorry, missed your comment. Created PR #5579 to add cleanup-on-fail option support when running rollback operation due to upgrade failure when using atomic. |
What this PR does / why we need it:
Add possibility to put "--safe" argument to install and upgrade command that restores the state of cluster in case of failed install/upgrade attempt.
This resolves the problem of non-atomic upgrade process in helm and removes need to write scripts to handle failed deployments. Also, closes #3338.
Special notes for your reviewer:
This is a proposal for such functionality, so I haven't any documentation and unit tests yet. However I've tested this functionality by hands on living cluster.
Also, I am not a professional Go developer, so if there are ways to improve implementation with fluent Go cunstructions, I would be glad for suggestions.
If applicable: