Set a delete strategy for job deletes
Setting Orphan delete strategy on job deletes in the tests.
Deleting without a strategy is deprecated since k8s 1.20 and creates a
lot of messages in the job logs.
@@ -1820,7 +1820,9 @@ func cleanNamespaces() {
util2.PanicOnError(err)
//Remove all Jobs
- util2.PanicOnError(virtCli.BatchV1().RESTClient().Delete().Namespace(namespace).Resource("jobs").Do(context.Background()).Error())
+ jobDeleteStrategy := metav1.DeletePropagationOrphan
+ jobDeleteOptions := metav1.DeleteOptions{PropagationPolicy: &jobDeleteStrategy}
+ util2.PanicOnError(virtCli.BatchV1().RESTClient().Delete().Namespace(namespace).Resource("jobs").Body(&jobDeleteOptions).Do(context.Background()).Error())
//Remove all HPA
util2.PanicOnError(virtCli.AutoscalingV1().RESTClient().Delete().Namespace(namespace).Resource("horizontalpodautoscalers").Do(context.Background()).Error())
