Skip to content

Commit 37d90e7

Browse files
committed
Address Copilot review comments: null-safe RoutingConfigurationText, mutual exclusion validation, bounded polling loops
1 parent 63f1468 commit 37d90e7

13 files changed

Lines changed: 71 additions & 9 deletions

src/Network/Network.Management.Sdk/Generated/Models/BgpConnection.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,13 @@ public BgpConnection()
122122
/// </summary>
123123
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.connectionState")]
124124
public string ConnectionState {get; private set; }
125+
126+
/// <summary>
127+
/// Gets or sets the routing configuration indicating the associated and
128+
/// propagated route tables for this connection.
129+
/// </summary>
130+
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingConfiguration")]
131+
public RoutingConfiguration RoutingConfiguration {get; set; }
125132
/// <summary>
126133
/// Validate the object.
127134
/// </summary>

src/Network/Network.Management.Sdk/Generated/Models/BgpConnectionProperties.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,13 @@ public BgpConnectionProperties()
8686
/// </summary>
8787
[Newtonsoft.Json.JsonProperty(PropertyName = "connectionState")]
8888
public string ConnectionState {get; private set; }
89+
90+
/// <summary>
91+
/// Gets or sets the routing configuration indicating the associated and
92+
/// propagated route tables for this connection.
93+
/// </summary>
94+
[Newtonsoft.Json.JsonProperty(PropertyName = "routingConfiguration")]
95+
public RoutingConfiguration RoutingConfiguration {get; set; }
8996
/// <summary>
9097
/// Validate the object.
9198
/// </summary>

src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnection.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,13 @@ public VirtualNetworkGatewayConnection()
374374
/// </summary>
375375
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.authenticationType")]
376376
public string AuthenticationType {get; set; }
377+
378+
/// <summary>
379+
/// Gets or sets the routing configuration indicating the associated and
380+
/// propagated route tables for this connection.
381+
/// </summary>
382+
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingConfiguration")]
383+
public RoutingConfiguration RoutingConfiguration {get; set; }
377384
/// <summary>
378385
/// Validate the object.
379386
/// </summary>

src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntity.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,13 @@ public VirtualNetworkGatewayConnectionListEntity()
308308
/// </summary>
309309
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.enablePrivateLinkFastPath")]
310310
public bool? EnablePrivateLinkFastPath {get; set; }
311+
312+
/// <summary>
313+
/// Gets or sets the routing configuration indicating the associated and
314+
/// propagated route tables for this connection.
315+
/// </summary>
316+
[Newtonsoft.Json.JsonProperty(PropertyName = "properties.routingConfiguration")]
317+
public RoutingConfiguration RoutingConfiguration {get; set; }
311318
/// <summary>
312319
/// Validate the object.
313320
/// </summary>

src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionListEntityPropertiesFormat.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,13 @@ public VirtualNetworkGatewayConnectionListEntityPropertiesFormat()
280280
/// </summary>
281281
[Newtonsoft.Json.JsonProperty(PropertyName = "enablePrivateLinkFastPath")]
282282
public bool? EnablePrivateLinkFastPath {get; set; }
283+
284+
/// <summary>
285+
/// Gets or sets the routing configuration indicating the associated and
286+
/// propagated route tables for this connection.
287+
/// </summary>
288+
[Newtonsoft.Json.JsonProperty(PropertyName = "routingConfiguration")]
289+
public RoutingConfiguration RoutingConfiguration {get; set; }
283290
/// <summary>
284291
/// Validate the object.
285292
/// </summary>

src/Network/Network.Management.Sdk/Generated/Models/VirtualNetworkGatewayConnectionPropertiesFormat.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,13 @@ public VirtualNetworkGatewayConnectionPropertiesFormat()
346346
/// </summary>
347347
[Newtonsoft.Json.JsonProperty(PropertyName = "certificateAuthentication")]
348348
public CertificateAuthentication CertificateAuthentication {get; set; }
349+
350+
/// <summary>
351+
/// Gets or sets the routing configuration indicating the associated and
352+
/// propagated route tables for this connection.
353+
/// </summary>
354+
[Newtonsoft.Json.JsonProperty(PropertyName = "routingConfiguration")]
355+
public RoutingConfiguration RoutingConfiguration {get; set; }
349356
/// <summary>
350357
/// Validate the object.
351358
/// </summary>

src/Network/Network.Test/ScenarioTests/RouteServerTests.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -246,12 +246,16 @@ function Test-RouteServerPeerWithRoutingConfiguration
246246
# Get the route server hub and wait for provisioning
247247
$virtualHubName = $routeServerName
248248
$virtualHub = Get-AzVirtualHub -ResourceGroupName $rgname -Name $virtualHubName
249-
while ($virtualHub.RoutingState -eq "Provisioning")
249+
$routingStatePollIntervalSeconds = 180
250+
$maxRoutingStatePollAttempts = 10
251+
$routingStatePollAttempt = 0
252+
while ($virtualHub.RoutingState -eq "Provisioning" -and $routingStatePollAttempt -lt $maxRoutingStatePollAttempts)
250253
{
251-
Start-TestSleep -Seconds 180
254+
Start-TestSleep -Seconds $routingStatePollIntervalSeconds
252255
$virtualHub = Get-AzVirtualHub -ResourceGroupName $rgname -Name $virtualHubName
256+
$routingStatePollAttempt++
253257
}
254-
Assert-AreEqual $virtualHub.RoutingState "Provisioned"
258+
Assert-AreEqual "Provisioned" $virtualHub.RoutingState
255259

256260
# Create a route map on the route server hub
257261
$routeMapMatchCriterion1 = New-AzRouteMapRuleCriterion -MatchCondition "Contains" -RoutePrefix @("10.0.0.0/16")

src/Network/Network.Test/ScenarioTests/VirtualNetworkGatewayConnectionTests.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1145,12 +1145,16 @@ function Test-VirtualNetworkGatewayConnectionWithRoutingConfiguration
11451145
Assert-NotNull $virtualHub
11461146

11471147
# Wait for Virtual Hub Routing State to become Provisioned
1148-
while ($virtualHub.RoutingState -eq "Provisioning")
1148+
$routingStatePollIntervalSeconds = 180
1149+
$maxRoutingStatePollAttempts = 10
1150+
$routingStatePollAttempt = 0
1151+
while ($virtualHub.RoutingState -eq "Provisioning" -and $routingStatePollAttempt -lt $maxRoutingStatePollAttempts)
11491152
{
1150-
Start-TestSleep -Seconds 180
1153+
Start-TestSleep -Seconds $routingStatePollIntervalSeconds
11511154
$virtualHub = Get-AzVirtualHub -ResourceGroupName $rgname -Name $virtualHubName
1155+
$routingStatePollAttempt++
11521156
}
1153-
Assert-AreEqual $virtualHub.RoutingState "Provisioned"
1157+
Assert-AreEqual "Provisioned" $virtualHub.RoutingState
11541158

11551159
# Create a route map on the route server hub
11561160
$routeMapMatchCriterion1 = New-AzRouteMapRuleCriterion -MatchCondition "Contains" -RoutePrefix @("10.0.0.0/16")

src/Network/Network/Generated/Models/PSBgpConnection.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public partial class PSBgpConnection : PSChildResource
3838
[JsonIgnore]
3939
public string RoutingConfigurationText
4040
{
41-
get { return JsonConvert.SerializeObject(RoutingConfiguration, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
41+
get { return RoutingConfiguration == null ? string.Empty : JsonConvert.SerializeObject(RoutingConfiguration, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
4242
}
4343
}
4444
}

src/Network/Network/Generated/Models/PSRouteServerPeer.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public partial class PSRouteServerPeer : PSChildResource
2121
[JsonIgnore]
2222
public string RoutingConfigurationText
2323
{
24-
get { return JsonConvert.SerializeObject(RoutingConfiguration, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
24+
get { return RoutingConfiguration == null ? string.Empty : JsonConvert.SerializeObject(RoutingConfiguration, Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); }
2525
}
2626
}
2727
}

0 commit comments

Comments
 (0)