// Delete the random pods and return error value
Delete the random pods and return error value
// Delete the random pods and return error value
func deletePods(clientset *kubernetes.Clientset, deletablePods []v1.Pod,
	numDeletePods int) error {
	r := rand.New(rand.NewSource(time.Now().UnixNano()))
	for i := 0; i < numDeletePods; i++ {
		podToBeDeleted := deletablePods[r.Intn(len(deletablePods))]
		err := deletePod(clientset, podToBeDeleted)
		if err != nil {
			return err
		}
	}
	return nil
}
func deletePods ( clientset * kubernetes . Clientset , deletablePods [ ] v1 . Pod , numDeletePods int ) error { r := rand . New ( rand . NewSource ( time . Now ( ) . UnixNano ( ) ) ) for i := 0 ; i < numDeletePods ; i ++ { podToBeDeleted := deletablePods [ r . Intn ( len ( deletablePods ) ) ] err := deletePod ( clientset , podToBeDeleted ) if err != nil { return err } } return nil }
Delete the random pods and return error value
Delete the random pods and return error value