Repository navigation
Fix no RESOURCE with the name NAME found - #4871
Conversation
a740989 to
368f85d
Compare
368f85d to
000296d
Compare
|
This seems like a good approach to the problem. I'll start testing this with a few charts tomorrow. Thanks for the fix, @distorhead! |
bacongobbler
left a comment
There was a problem hiding this comment.
one small change, otherwise works as expected when tested manually.
000296d to
e675db2
Compare
e675db2 to
d01441b
Compare
|
I'll bring this ticket up in today's dev call since I'm not entirely sure if there may be some cases where we do not want to delete newly created resources. |
|
Note, AppVeyor is currently always failing. We can ignore this as it's unrelated to the PR. |
|
^^ yes thank you :) currently working on that in #4897 |
|
@michelleN I think that's a great idea. I'm also feeling incredibly wary about introducing anything related to resource deletion by default, especially on upgrade. Hiding this functionality behind a feature flag would allow users to opt into this (destructive) behaviour with little risk for users who aren't hitting this edge case. Good suggestion. 👍 |
|
Ok, I see your point. What option name do you propose? Does Some thoughts:
In total:
|
We're currently looking at the resource upgrade strategy for Helm 3. It may be a 3-way merge patch, or it could be something different. Either way we are certainly looking into ways to improve the current upgrade strategy, but we don't have any news or reports to share at this time.
|
bacongobbler
left a comment
There was a problem hiding this comment.
removing "approved" status for the time being
4f16c39 to
874b8a6
Compare
874b8a6 to
8c32ab5
Compare
8c32ab5 to
ce17198
Compare
ce17198 to
13af1a1
Compare
This is the fix for only one particular, but important case. The case when a new resource has been added to the chart and there is an error in the chart, which leads to release failure. In this case after first failed release upgrade new resource will be created in the cluster. On the next release upgrade there will be the error: `no RESOURCE with the name NAME found` for this newly created resource from the previous release upgrade. The root of this problem is in the side effect of the first release process, Release invariant says: if resouce exists in the kubernetes cluster, then it should exist in the release storage. But this invariant has been broken by helm itself -- because helm created new resources as side effect and not adopted them into release storage. To maintain release invariant for such case during release upgrade operation all newly *successfully* created resources will be deleted in the case of an error in the subsequent resources update. This behaviour will be enabled only when `--cleanup-on-fail` option used for `helm upgrade` or `helm rollback`. Signed-off-by: Timofey Kirillov <[email protected]>
13af1a1 to
d6fa8da
Compare
|
@fbcbarbosa Merged your addition, thanks! Also rebased whole branch on the upstream master. |
Signed-off-by: Timofey Kirillov <[email protected]>
bacongobbler
left a comment
There was a problem hiding this comment.
needs another maintainer to review, but code LGTM.
|
I am working on reviewing this and testing manually |
thomastaylor312
left a comment
There was a problem hiding this comment.
This is looking good! Just one nit that won't block merging. I'll come back and give it a green check once I do some manual testing with it
| // | ||
| // Namespace will set the namespaces. | ||
| func (c *Client) Update(namespace string, originalReader, targetReader io.Reader, force bool, recreate bool, timeout int64, shouldWait bool) error { | ||
| func (c *Client) UpdateWithOptions(namespace string, originalReader, targetReader io.Reader, opts UpdateOptions) error { |
There was a problem hiding this comment.
This reads much cleaner and avoids breaking API changes when we need to add other things. Thanks for the great refactor!
…update Signed-off-by: Timofey Kirillov <[email protected]>
Signed-off-by: Timofey Kirillov <[email protected]>
thomastaylor312
left a comment
There was a problem hiding this comment.
Ok, manual testing on this looks good! Thanks for all of the hard work
This is the fix for only one particular, but important case.
The case when a new resource has been added to the chart and there is an error in the chart, which leads to release failure. In this case after first failed release upgrade new resource will be created in the cluster. On the next release upgrade there will be the error:
no RESOURCE with the name NAME foundfor this newly created resource from the previous release upgrade.The root of this problem is in the side effect of the first release process. Release invariant says: if resouce exists in the kubernetes cluster, then it should exist in the release storage. But this invariant has been broken by helm itself -- because helm created new resources as side effect and not adopted them into release storage.
To maintain release invariant for such case during release upgrade operation all newly successfully created resources will be deleted in the case of an error in the subsequent resources update.