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 <lrotenbe@redhat.com>
  • Loading branch information
liranr23 committed Dec 21, 2023
1 parent 20fbfdb commit ecfc590
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 no_custom_cpu_model = false

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

concerns[flag] {
no_custom_cpu_model
flag := {
"category": "Warning",
"label": "Custom CPU Model detected",
"assessment": "A custom CPU model is set on the VM. The CPU model of the VM might differ from your target cluster CPU."
}
}
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 ecfc590

Please sign in to comment.