Skip to content

Commit

Permalink
Do not remove container if start container failed
Browse files Browse the repository at this point in the history
  • Loading branch information
keyingliu authored and Yingke Liu committed Jan 31, 2019
1 parent d2a9cbc commit 06e9c20
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions pkg/libvirttools/virtualization.go
Original file line number Diff line number Diff line change
Expand Up @@ -448,15 +448,6 @@ func (v *VirtualizationTool) startContainer(containerID string) error {
// 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
}

Expand Down

0 comments on commit 06e9c20

Please sign in to comment.