Skip to content

Commit

Permalink
openstack: fix image format validation
Browse files Browse the repository at this point in the history
The format of the image is stored as image.diskFormat rather than
image.disk_format - change the validation and its tests accordingly.

Signed-off-by: Arik Hadas <[email protected]>
  • Loading branch information
ahadas committed Aug 28, 2023
1 parent f2599b0 commit a54a4c1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import future.keywords.if
default has_invalid_image_format = false

has_invalid_image_format if {
not regex.match(`qcow2|raw`, input.image.disk_format)
not regex.match(`qcow2|raw`, input.image.diskFormat)
}

concerns[flag] {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ test_with_valid_image_format {
"name": "test",
"image": {
"id": "b749c132-bb97-4145-b86e-a1751cf75e21",
"disk_format": "qcow2",
"diskFormat": "qcow2",
},
}
results := concerns with input as mock_vm
Expand All @@ -17,7 +17,7 @@ test_with_invalid_storage_type {
"name": "test",
"image": {
"id": "b749c132-bb97-4145-b86e-a1751cf75e21",
"disk_format": "ami",
"diskFormat": "ami",
},
}
results := concerns with input as mock_vm
Expand Down

0 comments on commit a54a4c1

Please sign in to comment.