Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,10 @@ patches:
target:
kind: VirtualMachine
name: vm
- patch: |-
- op: replace
path: /spec/disruptions/restartApprovalMode
value: Automatic
target:
kind: VirtualMachine
name: vm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ kind: Kustomization
nameSuffix: -restore-force
resources:
- ../../base
patches:
- patch: |-
- op: replace
path: /spec/disruptions/restartApprovalMode
value: Automatic
target:
kind: VirtualMachine
name: vm
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,11 @@ kind: Kustomization
nameSuffix: -restore-safe
resources:
- ../../base
patches:
- patch: |-
- op: replace
path: /spec/disruptions/restartApprovalMode
value: Automatic
target:
kind: VirtualMachine
name: vm
14 changes: 14 additions & 0 deletions tests/e2e/util_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -756,6 +756,7 @@ func SaveTestCaseDump(labels map[string]string, additional, namespace string) {

SaveTestCaseResources(labels, additional, namespace, tmpDir)
SavePodLogsAndDescriptions(labels, additional, namespace, tmpDir)
SaveIntvirtvmDescriptions(labels, additional, namespace, tmpDir)
}

func SaveTestCaseResources(labels map[string]string, additional, namespace, dumpPath string) {
Expand Down Expand Up @@ -825,6 +826,19 @@ func SavePodLogsAndDescriptions(labels map[string]string, additional, namespace,
}
}

func SaveIntvirtvmDescriptions(labels map[string]string, additional, namespace, dumpPath string) {
describeCmd := kubectl.RawCommand(fmt.Sprintf("describe intvirtvm --namespace %s", namespace), framework.ShortTimeout)
if describeCmd.Error() != nil {
GinkgoWriter.Printf("Failed to describe InternalVirtualizationVirtualMachine:\nError: %s\n", describeCmd.StdErr())
}

fileName := fmt.Sprintf("%s/e2e_failed__%s__%s__intvirtvm_describe", dumpPath, labels["testcase"], additional)
err := os.WriteFile(fileName, describeCmd.StdOutBytes(), 0o644)
if err != nil {
GinkgoWriter.Printf("Failed to save InternalVirtualizationVirtualMachine description:\nError: %s\n", err)
}
}

type Watcher interface {
Watch(ctx context.Context, opts metav1.ListOptions) (watch.Interface, error)
}
Expand Down
Loading