func ForceDeleteMayastorPods() bool {
	logf.Log.Info("EnsureMayastorDeleted")
	pods, err := gTestEnv.KubeInt.CoreV1().Pods("mayastor").List(context.TODO(), metav1.ListOptions{})
	if err != nil {
		logf.Log.Error(err, "EnsureMayastorDeleted: list pods failed.")
		return false
	}
	if pods == nil || len(pods.Items) == 0 {
		return false
	}

	logf.Log.Info("EnsureMayastorDeleted: MayastorPods found.", "Count", len(pods.Items))
	for _, pod := range pods.Items {
		logf.Log.Info("EnsureMayastorDeleted: Force deleting", "pod", pod.Name)
		cmd := exec.Command("kubectl", "-n", "mayastor", "delete", "pod", pod.Name, "--grace-period", "0", "--force")
		_, err := cmd.CombinedOutput()
		if err != nil {
			logf.Log.Error(err, "EnsureMayastorDeleted", "podName", pod.Name)
		}
	}

	// We have made the best effort to cleanup, give things time to settle.
	for attempts := 0; attempts < 30 && MayastorUndeletedPodCount() != 0; attempts++ {
		time.Sleep(2 * time.Second)
	}

	logf.Log.Info("EnsureMayastorDeleted: lingering Mayastor pods were found !!!!!!!!")
	return true
}
// Force deletion of all existing mayastor pods
// Returns true if pods were deleted, false otherwise
Force deletion of all existing mayastor pods
Returns true if pods were deleted, false otherwise
// Force deletion of all existing mayastor pods // Returns true if pods were deleted false otherwise
func ForceDeleteMayastorPods() bool {
	logf.Log.Info("EnsureMayastorDeleted")
	pods, err := gTestEnv.KubeInt.CoreV1().Pods("mayastor").List(context.TODO(), metav1.ListOptions{})
	if err != nil {
		logf.Log.Error(err, "EnsureMayastorDeleted: list pods failed.")
		return false
	}
	if pods == nil || len(pods.Items) == 0 {
		return false
	}
	logf.Log.Info("EnsureMayastorDeleted: MayastorPods found.", "Count", len(pods.Items))
	for _, pod := range pods.Items {
		logf.Log.Info("EnsureMayastorDeleted: Force deleting", "pod", pod.Name)
		cmd := exec.Command("kubectl", "-n", "mayastor", "delete", "pod", pod.Name, "--grace-period", "0", "--force")
		_, err := cmd.CombinedOutput()
		if err != nil {
			logf.Log.Error(err, "EnsureMayastorDeleted", "podName", pod.Name)
		}
	}
	for attempts := 0; attempts < 30 && MayastorUndeletedPodCount() != 0; attempts++ {
		time.Sleep(2 * time.Second)
	}
	logf.Log.Info("EnsureMayastorDeleted: lingering Mayastor pods were found !!!!!!!!")
	return true
}
func ForceDeleteMayastorPods ( ) bool { logf . Log . Info ( " " ) pods , err := gTestEnv . KubeInt . CoreV1 ( ) . Pods ( " " ) . List ( context . TODO ( ) , metav1 . ListOptions { } ) if err != nil { logf . Log . Error ( err , " " ) return false } if pods == nil || len ( pods . Items ) == 0 { return false } logf . Log . Info ( " " , " " , len ( pods . Items ) ) for _ , pod := range pods . Items { logf . Log . Info ( " " , " " , pod . Name ) cmd := exec . Command ( " " , " " , " " , " " , " " , pod . Name , " " , " " , " " ) _ , err := cmd . CombinedOutput ( ) if err != nil { logf . Log . Error ( err , " " , " " , pod . Name ) } } for attempts := 0 ; attempts < 30 && MayastorUndeletedPodCount ( ) != 0 ; attempts ++ { time . Sleep ( 2 * time . Second ) } logf . Log . Info ( " " ) return true }
Force deletion of all existing mayastor pods
Returns true if pods were deleted, false otherwise
Force deletion of all existing mayastor pods Returns true if pods were deleted false otherwise
// We have made the best effort to cleanup, give things time to settle.