Skip to content

Commit

Permalink
Add a custom CPU warning
Browse files Browse the repository at this point in the history
The validation will now check if the VM is set with custom CPU model and
show it to the user.

Signed-off-by: Liran Rotenberg <[email protected]>
  • Loading branch information
liranr23 committed Dec 24, 2023
1 parent 989cdca commit 571fd18
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.konveyor.forklift.ovirt

default custom_cpu_model = false

custom_cpu_model = true {
count(input.customCpuModel) != 0
}

concerns[flag] {
custom_cpu_model
flag := {
"category": "Warning",
"label": "Custom CPU Model detected",
"assessment": "The VM is configured with a custom CPU model. This configuration will apply to the migrated VM and may not be supported by OpenShift Virtualization."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package io.konveyor.forklift.ovirt

test_without_customcpu {
mock_vm := { "name": "test" }
results = concerns with input as mock_vm
count(results) == 0
}

test_with_customcpu {
mock_vm := { "name": "test",
"customCpuModel": "Icelake-Server-noTSX,-mpx"
}
results = concerns with input as mock_vm
count(results) == 1
}

0 comments on commit 571fd18

Please sign in to comment.