mirror of https://github.com/containers/podman.git
				
				
				
			Address review comments and fix ps output
Signed-off-by: Matthew Heon <matthew.heon@gmail.com>
This commit is contained in:
		
							parent
							
								
									2c7f97d5a7
								
							
						
					
					
						commit
						29dbab6440
					
				|  | @ -548,6 +548,8 @@ func getTemplateOutput(psParams []psJSONParams, opts shared.PsOptions) ([]psTemp | ||||||
| 		labels := formatLabels(psParam.Labels) | 		labels := formatLabels(psParam.Labels) | ||||||
| 
 | 
 | ||||||
| 		switch psParam.Status { | 		switch psParam.Status { | ||||||
|  | 		case libpod.ContainerStateExited.String(): | ||||||
|  | 			fallthrough | ||||||
| 		case libpod.ContainerStateStopped.String(): | 		case libpod.ContainerStateStopped.String(): | ||||||
| 			exitedSince := units.HumanDuration(time.Since(psParam.ExitedAt)) | 			exitedSince := units.HumanDuration(time.Since(psParam.ExitedAt)) | ||||||
| 			status = fmt.Sprintf("Exited (%d) %s ago", psParam.ExitCode, exitedSince) | 			status = fmt.Sprintf("Exited (%d) %s ago", psParam.ExitCode, exitedSince) | ||||||
|  |  | ||||||
|  | @ -332,9 +332,9 @@ func (r *Runtime) removeContainer(ctx context.Context, c *Container, force bool) | ||||||
| 		label.ReleaseLabel(c.ProcessLabel()) | 		label.ReleaseLabel(c.ProcessLabel()) | ||||||
| 		r.reserveLabels() | 		r.reserveLabels() | ||||||
| 	} | 	} | ||||||
| 	// Delete the container
 | 	// Delete the container.
 | ||||||
| 	// Only do this if we're not ContainerStateConfigured - if we are,
 | 	// Not needed in Configured and Exited states, where the container
 | ||||||
| 	// we haven't been created in the runtime yet
 | 	// doesn't exist in the runtime
 | ||||||
| 	if c.state.State != ContainerStateConfigured && | 	if c.state.State != ContainerStateConfigured && | ||||||
| 		c.state.State != ContainerStateExited { | 		c.state.State != ContainerStateExited { | ||||||
| 		if err := c.delete(ctx); err != nil { | 		if err := c.delete(ctx); err != nil { | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue