-
Notifications
You must be signed in to change notification settings - Fork 706
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
Delete failed installations #1320
Conversation
pkg/proxy/proxy.go
Outdated
return nil, fmt.Errorf("Unable to create the release: %v", err) | ||
errDelete := p.deleteRelease(name, namespace, true) | ||
if errDelete != nil { | ||
return nil, fmt.Errorf("Unable to create the release: %v and unable to uninstall it: %v", err, errDelete) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wouldn't need to uninstall a release which was not created. I think helm's messaging here is a little clearer, in that the release failed. Something like:
"Release %q failed: %v. Unable to purge failed release: %v"
Though it'd be nicer to wrap the error (like the helm code for atomic does).
pkg/proxy/proxy.go
Outdated
if errDelete != nil { | ||
return nil, fmt.Errorf("Unable to create the release: %v and unable to uninstall it: %v", err, errDelete) | ||
} | ||
return nil, fmt.Errorf("Unable to create the release and has been uninstalled: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly here: "Release %q failed and has been uninstalled: %v"
if err == nil { | ||
t.Error("Release should fail, an existing release in a different namespace already exists") | ||
} | ||
if !strings.Contains(err.Error(), "already exists") { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you try adding a test for the actual deletion and it was not worth it for now? (given that tiller-proxy is dying).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, there is no easy way for the current fake helm implementation to fail doing an installation
Description of the change
When creating a release, if it fails for some reason (like band inputs) clean up the release afterwards so the same name can be reused.
BTW, there is no an "atomic" flag that we can use in the CreateRelease action for helm, this is the code:
https://github.com/helm/helm/blob/456eb7f4118a635427bd43daa3d7aabf29304f13/pkg/action/install.go#L313
Possible drawbacks
If the release failed to be installed but it's not stored as a failed release (for example for an invalid name) we will be returning also an error for the missing release when trying to delete it, which might be confusing.
Applicable issues
cc/ @SimonAlling since these changes affect to tiller-proxy