// RemovePodSandbox deletes the sandbox. If there are any running containers in the
// sandbox, they should be force deleted.
RemovePodSandbox deletes the sandbox. If there are any running containers in the
sandbox, they should be force deleted.
// RemovePodSandbox deletes the sandbox . If there are any running containers in the // sandbox they should be force deleted .
func (u *UnikernelRuntime) RemovePodSandbox(podSandboxID string) error {
	sandbox, err := u.sandboxStore.Get(podSandboxID)
	if err != nil {
		if err == store.ErrNotExist {
			return nil
		}
		return fmt.Errorf("failed to find sandbox(%q): %v", podSandboxID, err)
	}
	ctrs, err := u.getAllContainersInPod(sandbox.ID)
	if err != nil {
		return fmt.Errorf("failed to get all containers for sandbox(%q): %v", podSandboxID, err)
	}
	if len(ctrs) > 1 {
		glog.Warningf("Get more than one(%d) containers in sandbox %q, remove them all", len(ctrs), sandbox.ID)
	}
	for _, ctr := range ctrs {
		if err = u.RemoveContainer(ctr.ID); err != nil {
			return err
		}
	}
	if err = u.sandboxStore.Delete(sandbox.ID); err != nil {
		return fmt.Errorf("failed to delete sandbox(%q) metadata: %v", sandbox.ID, err)
	}
	return nil
}
func ( u * UnikernelRuntime ) RemovePodSandbox ( podSandboxID string ) error { sandbox , err := u . sandboxStore . Get ( podSandboxID ) if err != nil { if err == store . ErrNotExist { return nil } return fmt . Errorf ( " " , podSandboxID , err ) } ctrs , err := u . getAllContainersInPod ( sandbox . ID ) if err != nil { return fmt . Errorf ( " " , podSandboxID , err ) } if len ( ctrs ) > 1 { glog . Warningf ( " " , len ( ctrs ) , sandbox . ID ) } for _ , ctr := range ctrs { if err = u . RemoveContainer ( ctr . ID ) ; err != nil { return err } } if err = u . sandboxStore . Delete ( sandbox . ID ) ; err != nil { return fmt . Errorf ( " " , sandbox . ID , err ) } return nil }
RemovePodSandbox deletes the sandbox.
RemovePodSandbox deletes the sandbox .
// Get sandbox and all containers in sandbox // Remove all containers found in sandbox, although we expected only one exist.