Skip to content
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

Do not remove container if start container failed #858

Merged
merged 1 commit into from
Feb 4, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 1 addition & 14 deletions pkg/libvirttools/virtualization.go
Original file line number Diff line number Diff line change
Expand Up @@ -447,20 +447,7 @@ func (v *VirtualizationTool) startContainer(containerID string) error {
// If there was an error it will be returned to caller after an domain removal
// attempt. If also it had an error - both of them will be combined.
func (v *VirtualizationTool) StartContainer(containerID string) error {
if err := v.startContainer(containerID); err != nil {
// FIXME: we do this here because kubelet may attempt new `CreateContainer()`
// calls for this VM after failed `StartContainer()` without first removing it.
// Better solution is perhaps moving domain setup logic to `StartContainer()`
// and cleaning it all up upon failure, but for now we just remove the VM
// so the next `CreateContainer()` call succeeds.
if rmErr := v.RemoveContainer(containerID); rmErr != nil {
return fmt.Errorf("container start error: %v \n+ container removal error: %v", err, rmErr)
}

return err
}

return nil
return v.startContainer(containerID)
}

// StopContainer calls graceful shutdown of domain and if it was non successful
Expand Down