// StopPod stops a pod.
StopPod stops a pod.
// StopPod stops a pod .
func (c *Client) StopPod(podID string) (int, string, error) {
	ctx, cancel := getContextWithTimeout(hyperContextTimeout)
	defer cancel()
	isRunning, err := isPodSandboxRunning(c, podID)
	if err != nil {
		return 0, "", err
	}
	if !isRunning {
		glog.V(3).Infof("PodSandbox %q is already stopped, skip", podID)
		return 0, "", nil
	}
	resp, err := c.client.PodStop(ctx, &types.PodStopRequest{
		PodID: podID,
	})
	if err != nil {
		return 0, "", err
	}
	return int(resp.Code), resp.Cause, nil
}
func ( c * Client ) StopPod ( podID string ) ( int , string , error ) { ctx , cancel := getContextWithTimeout ( hyperContextTimeout ) defer cancel ( ) isRunning , err := isPodSandboxRunning ( c , podID ) if err != nil { return 0 , " " , err } if ! isRunning { glog . V ( 3 ) . Infof ( " " , podID ) return 0 , " " , nil } resp , err := c . client . PodStop ( ctx , & types . PodStopRequest { PodID : podID , } ) if err != nil { return 0 , " " , err } return int ( resp . Code ) , resp . Cause , nil }
StopPod stops a pod.
StopPod stops a pod .