e2e: fix a panic call in beforesuite
We had a situation in e2e where we hit the 'Test Panicked'
assertion but without a stack trace or an error message.
The reason was that panic(err) was called with err being nil.
This patch fixes the err assignment
@@ -115,10 +115,11 @@ func DeleteRawManifest(object unstructured.Unstructured) error {
options := &metav1.DeleteOptions{PropagationPolicy: &policy}
result := virtCli.CoreV1().RESTClient().Delete().RequestURI(uri).Body(options).Do(context.Background())
- if result.Error() != nil && !k8serrors.IsNotFound(result.Error()) {
- fmt.Printf(fmt.Sprintf("ERROR: Can not delete %s err: %#v %s\n", object.GetName(), result.Error(), object))
- panic(err)
+ if err = result.Error(); err != nil && !k8serrors.IsNotFound(err) {
+ panic(fmt.Errorf("ERROR: Can not delete %s err: %#v %s\n", object.GetName(), err, object))
+
}
+
return nil
}
