-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Liran Rotenberg <[email protected]>
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package io.konveyor.forklift.ovirt | ||
|
||
default has_tpm_enabled = false | ||
|
||
has_tpm_enabled = value { | ||
value := input.tpmEnabled | ||
} | ||
|
||
concerns[flag] { | ||
has_tpm_enabled | ||
flag := { | ||
"category": "Warning", | ||
"label": "VM configured with TPM device", | ||
"assessment": "The VM is configured with TPM device. TPM data will be loss during the migration." | ||
} | ||
} |
17 changes: 17 additions & 0 deletions
17
validation/policies/io/konveyor/forklift/ovirt/tpm_test.rego
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package io.konveyor.forklift.ovirt | ||
|
||
test_without_tpm_enabled { | ||
mock_vm := { "name": "test", | ||
"tpmEnabled": false | ||
} | ||
results = concerns with input as mock_vm | ||
count(results) == 0 | ||
} | ||
|
||
test_with_tpm_enabled { | ||
mock_vm := { "name": "test", | ||
"tpmEnabled": true | ||
} | ||
results = concerns with input as mock_vm | ||
count(results) == 1 | ||
} |