Skip to content

Commit 4ea0d21

Browse files
Copilotpsah434
andcommitted
Fix preview offer check to only flag offers ending with -preview
Co-authored-by: psah434 <114955590+psah434@users.noreply.github.com>
1 parent 28d82a0 commit 4ea0d21

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

arm-ttk/testcases/deploymentTemplate/Virtual-Machines-Should-Not-Be-Preview.test.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ foreach ($sp in $storageProfiles) {
2626
if ($storageProfile.imageReference -like '*preview' -or `
2727
$storageProfile.imageReference.version -like '*preview' -or `
2828
$storageProfile.imageReference.sku -like '*preview' -or `
29-
$storageProfile.imageReference.offer -like '*preview*') {
29+
$storageProfile.imageReference.offer -like '*-preview') {
3030
Write-Error "StorageProfile for resource '$($sp.ParentObject.Name)' must not use a preview version" -TargetObject $sp -ErrorId VM.Using.Preview.Image
3131
}
3232
}

unit-tests/Virtual-Machines-Should-Not-Be-Preview/Fail/Latest-Preview-offer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"imageReference": {
1010
"publisher": "Canonical",
1111
"version": "latest",
12-
"offer": "UbuntuServer_preview",
12+
"offer": "UbuntuServer-preview",
1313
"sku": "16.04-LTS"
1414
}
1515
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
{
2+
"$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#",
3+
"resources": [
4+
{
5+
"type": "Microsoft.Compute/virtualMachines",
6+
"apiVersion": "2019-12-01",
7+
"properties": {
8+
"storageProfile": {
9+
"imageReference": {
10+
"publisher": "TrendMicro",
11+
"version": "latest",
12+
"offer": "zero-trust-secure-access-preview-st",
13+
"sku": "standard"
14+
}
15+
}
16+
}
17+
}
18+
]
19+
}

0 commit comments

Comments
 (0)