-
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.
We cannot support this currently Signed-off-by: Benny Zlotnik <[email protected]>
- Loading branch information
Showing
3 changed files
with
24 additions
and
24 deletions.
There are no files selected for viewing
18 changes: 0 additions & 18 deletions
18
validation/policies/io/konveyor/forklift/openstack/image_format.rego
This file was deleted.
Oops, something went wrong.
18 changes: 18 additions & 0 deletions
18
validation/policies/io/konveyor/forklift/openstack/volume_based.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,18 @@ | ||
package io.konveyor.forklift.openstack | ||
|
||
import future.keywords.if | ||
|
||
default not_volume_based = false | ||
|
||
not_volume_based if { | ||
input.imageID != "" | ||
} | ||
|
||
concerns[flag] { | ||
not_volume_based | ||
flag := { | ||
"category": "Critical", | ||
"label": "Unsupported image format detected", | ||
"assessment": "The VM is not volume based, currently only volume based VMs can be imported.", | ||
} | ||
} |
12 changes: 6 additions & 6 deletions
12
...forklift/openstack/image_format_test.rego → ...forklift/openstack/volume_based_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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
package io.konveyor.forklift.openstack | ||
|
||
test_with_valid_image_format { | ||
test_image_based_vm { | ||
mock_vm := { | ||
"name": "test", | ||
"imageID": "b749c132-bb97-4145-b86e-a1751cf75e21", | ||
"image": { | ||
"id": "b749c132-bb97-4145-b86e-a1751cf75e21", | ||
"diskFormat": "qcow2", | ||
}, | ||
} | ||
results := concerns with input as mock_vm | ||
count(results) == 0 | ||
count(results) == 1 | ||
} | ||
|
||
test_with_invalid_storage_type { | ||
test_volume_based_vm { | ||
mock_vm := { | ||
"name": "test", | ||
"image": { | ||
"id": "b749c132-bb97-4145-b86e-a1751cf75e21", | ||
"diskFormat": "ami", | ||
}, | ||
"volumes": [] | ||
} | ||
results := concerns with input as mock_vm | ||
count(results) == 1 | ||
count(results) == 0 | ||
} |