mirror of
				https://github.com/optim-enterprises-bv/kubernetes.git
				synced 2025-11-04 04:08:16 +00:00 
			
		
		
		
	fake docker client can remove containers which have not been started
This commit is contained in:
		@@ -661,6 +661,15 @@ func (f *FakeDockerClient) RemoveContainer(id string, opts dockertypes.Container
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
	}
 | 
			
		||||
	for i := range f.RunningContainerList {
 | 
			
		||||
		// allow removal of running containers which are not running
 | 
			
		||||
		if f.RunningContainerList[i].ID == id && !f.ContainerMap[id].State.Running {
 | 
			
		||||
			delete(f.ContainerMap, id)
 | 
			
		||||
			f.RunningContainerList = append(f.RunningContainerList[:i], f.RunningContainerList[i+1:]...)
 | 
			
		||||
			f.appendContainerTrace("Removed", id)
 | 
			
		||||
			return nil
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
	// To be a good fake, report error if container is not stopped.
 | 
			
		||||
	return fmt.Errorf("container not stopped")
 | 
			
		||||
}
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user