func DeleteAllPods() (bool, int) {
	logf.Log.Info("DeleteAllPods")
	success := true
	numPods := 0
	pods, err := gTestEnv.KubeInt.CoreV1().Pods("default").List(context.TODO(), metav1.ListOptions{})
	if err != nil {
		logf.Log.Error(err, "DeleteAllPods: list pods failed.")
		success = false
	}
	if err == nil && pods != nil {
		numPods = len(pods.Items)
		for _, pod := range pods.Items {
			logf.Log.Info("DeleteAllPods: Deleting", "pod", pod.Name)
			if err := DeletePod(pod.Name); err != nil {
				success = false
			}
		}
	}
	return success, numPods
}
/// Delete all pods in the default namespace
// returns:
// 1) success i.e. true if all pods were deleted or there were no pods to delete.
// 2) the number of pods found
Delete all pods in the default namespace
returns:
1) success i.e. true if all pods were deleted or there were no pods to delete.
2) the number of pods found
/// Delete all pods in the default namespace // returns : // 1 ) success i . e . true if all pods were deleted or there were no pods to delete . // 2 ) the number of pods found
func DeleteAllPods() (bool, int) {
	logf.Log.Info("DeleteAllPods")
	success := true
	numPods := 0
	pods, err := gTestEnv.KubeInt.CoreV1().Pods("default").List(context.TODO(), metav1.ListOptions{})
	if err != nil {
		logf.Log.Error(err, "DeleteAllPods: list pods failed.")
		success = false
	}
	if err == nil && pods != nil {
		numPods = len(pods.Items)
		for _, pod := range pods.Items {
			logf.Log.Info("DeleteAllPods: Deleting", "pod", pod.Name)
			if err := DeletePod(pod.Name); err != nil {
				success = false
			}
		}
	}
	return success, numPods
}
func DeleteAllPods ( ) ( bool , int ) { logf . Log . Info ( " " ) success := true numPods := 0 pods , err := gTestEnv . KubeInt . CoreV1 ( ) . Pods ( " " ) . List ( context . TODO ( ) , metav1 . ListOptions { } ) if err != nil { logf . Log . Error ( err , " " ) success = false } if err == nil && pods != nil { numPods = len ( pods . Items ) for _ , pod := range pods . Items { logf . Log . Info ( " " , " " , pod . Name ) if err := DeletePod ( pod . Name ) ; err != nil { success = false } } } return success , numPods }
Delete all pods in the default namespace
returns:
1) success i.e.
Delete all pods in the default namespace returns : 1 ) success i . e .