File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed
arm-ttk/testcases/deploymentTemplate
unit-tests/apiversions-should-be-recent/Pass Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change @@ -71,6 +71,12 @@ foreach ($av in $allApiVersions) {
7171 continue
7272 }
7373
74+ # skip checking this resource only, if metadata array contains the disable directive
75+ if ($av.metadata -contains ' disable-apiVersions-should-be-recent' ){
76+ Write-Warning " Skipping check on $ ( $av.type ) /$ ( $av.name ) with apiVersion: $ ( $av.apiVersion ) "
77+ continue
78+ }
79+
7480 # Then walk over each object containing an ApiVersion.
7581 if ($av.ApiVersion -isnot [string ]) {
7682 # If the APIVersion is not a string
Original file line number Diff line number Diff line change 1+ {
2+ "$schema" : " https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#" ,
3+ "contentVersion" : " 1.0.0.0" ,
4+ "parameters" : {},
5+ "functions" : [],
6+ "variables" : {},
7+ "resources" : [
8+ {
9+ "metadata" : [" disable-apiVersions-should-be-recent" ],
10+ "name" : " publicIPAddress1" ,
11+ "type" : " Microsoft.Network/publicIPAddresses" ,
12+ "apiVersion" : " 2015-06-15" ,
13+ "location" : " [resourceGroup().location]" ,
14+ "tags" : {
15+ "displayName" : " publicIPAddress1"
16+ },
17+ "properties" : {
18+ "publicIPAllocationMethod" : " Dynamic"
19+ }
20+ }
21+ ],
22+ "outputs" : {}
23+ }
You can’t perform that action at this time.
0 commit comments