Dump VM Exports on tests failure
@@ -168,6 +168,7 @@ func (r *KubernetesReporter) dumpNamespaces(duration time.Duration, vmiNamespace
r.logVMSnapshot(virtCli)
r.logVMRestore(virtCli)
r.logDVs(virtCli)
+ r.logVMExports(virtCli)
r.logDeployments(virtCli)
r.logDaemonsets(virtCli)
@@ -758,6 +759,16 @@ func (r *KubernetesReporter) logDVs(virtCli kubecli.KubevirtClient) {
r.logObjects(virtCli, dvs, "dvs")
}
+func (r *KubernetesReporter) logVMExports(virtCli kubecli.KubevirtClient) {
+ vmexports, err := virtCli.VirtualMachineExport(v1.NamespaceAll).List(context.Background(), metav1.ListOptions{})
+ if err != nil {
+ fmt.Fprintf(os.Stderr, "failed to fetch vm exports: %v\n", err)
+ return
+ }
+
+ r.logObjects(virtCli, vmexports, "vmexports")
+}
+
func (r *KubernetesReporter) logObjects(virtCli kubecli.KubevirtClient, elements interface{}, name string) {
if elements == nil {
fmt.Fprintf(os.Stderr, "%s list is empty, skipping\n", name)
