Skip to content

Commit 42d1677

Browse files
authored
Merge pull request #21503 from wastoresh/mergestorage
[Do not Squash] Merge main change to storage preview branch
2 parents 7a69dd8 + 157945d commit 42d1677

File tree

82 files changed

+7577
-203
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

82 files changed

+7577
-203
lines changed

.azure-pipelines/test-coverage.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,10 @@ jobs:
111111
pwsh: true
112112
targetType: inline
113113
script: |
114+
git checkout -b testcoverage-baseline
114115
$blDir = "./tools/TestFx/Coverage"
115116
$blCsv = Join-Path -Path $blDir -ChildPath "Baseline.csv"
116-
if (Test-Path -Path $blCsv) {
117-
Remove-Item -Path $blCsv -Force
118-
}
119-
120-
git checkout -b testcoverage-baseline
121-
Copy-Item -Path "$(Pipeline.Workspace)/artifacts/TestCoverageAnalysis/Results/Baseline.csv" -Destination $blDir
117+
Copy-Item -Path "$(Pipeline.Workspace)/artifacts/TestCoverageAnalysis/Results/Baseline.csv" -Destination $blDir -Force
122118
git config user.email "[email protected]"
123119
git config user.name "azure-powershell-bot"
124120
git add $blCsv

src/Accounts/Accounts/ChangeLog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
-->
2020

2121
## Upcoming Release
22+
* Updated Azure.Core to 1.30.0.
2223

2324
## Version 2.12.1
2425
* Fixed an issue that broke some cmdlets in Az.Synapse module.

src/Accounts/AssemblyLoading/ConditionalAssemblyProvider.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static void Initialize(string rootPath, IConditionalAssemblyContext conte
4242
// todo: add a tool to update assembly versions after replacing the assemblies. (Can it support newly introduced assemblies?)
4343
// todo: consider moving the list to a standalone config file
4444
#region AssemblyList
45-
CreateAssembly("netcoreapp2.1", "Azure.Core", "1.28.0.0").WithPowerShellCore(),
45+
CreateAssembly("netcoreapp2.1", "Azure.Core", "1.30.0.0").WithPowerShellCore(),
4646
CreateAssembly("netcoreapp2.1", "Microsoft.Identity.Client", "4.49.1.0").WithPowerShellCore(),
4747
CreateAssembly("netcoreapp3.1", "Microsoft.Identity.Client.Extensions.Msal", "2.23.0.0").WithPowerShellCore(),
4848

@@ -64,7 +64,7 @@ public static void Initialize(string rootPath, IConditionalAssemblyContext conte
6464
CreateAssembly("netstandard2.0", "System.ServiceModel.Primitives", "4.7.0.0").WithWindowsPowerShell(),
6565
CreateAssembly("netstandard2.0", "System.Threading.Tasks.Extensions", "4.2.0.1").WithWindowsPowerShell(),
6666

67-
CreateAssembly("netfx", "Azure.Core", "1.28.0.0").WithWindowsPowerShell(),
67+
CreateAssembly("netfx", "Azure.Core", "1.30.0.0").WithWindowsPowerShell(),
6868
CreateAssembly("netfx", "Microsoft.Identity.Client", "4.49.1.0").WithWindowsPowerShell(),
6969
CreateAssembly("netfx", "Microsoft.Identity.Client.Extensions.Msal", "2.23.0.0").WithWindowsPowerShell(),
7070
CreateAssembly("netfx", "Newtonsoft.Json", "12.0.0.0").WithWindowsPowerShell(),

src/Aks/Aks.Test/ScenarioTests/KubernetesTests.cs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,5 +198,19 @@ public void TestPodSubnetID()
198198
{
199199
TestRunner.RunTestScript("Test-PodSubnetID");
200200
}
201+
202+
[Fact]
203+
[Trait(Category.AcceptanceType, Category.CheckIn)]
204+
public void TestEnableOidcIssuer()
205+
{
206+
TestRunner.RunTestScript("Test-EnableOidcIssuer");
207+
}
208+
209+
[Fact]
210+
[Trait(Category.AcceptanceType, Category.CheckIn)]
211+
public void TestOutboundType()
212+
{
213+
TestRunner.RunTestScript("Test-OutboundType");
214+
}
201215
}
202216
}

src/Aks/Aks.Test/ScenarioTests/KubernetesTests.ps1

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1161,4 +1161,55 @@ function Test-PodSubnetID {
11611161
finally {
11621162
Remove-AzResourceGroup -Name $resourceGroupName -Force
11631163
}
1164+
}
1165+
1166+
function Test-EnableOidcIssuer {
1167+
# Setup
1168+
$resourceGroupName = Get-RandomResourceGroupName
1169+
$kubeClusterName1 = Get-RandomClusterName
1170+
$kubeClusterName2 = Get-RandomClusterName
1171+
$location = 'eastus'
1172+
$nodeVmSize = "Standard_D2_v2"
1173+
1174+
try {
1175+
New-AzResourceGroup -Name $resourceGroupName -Location $location
1176+
1177+
New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName1 -NodeVmSize $nodeVmSize -NodeCount 1 -EnableOidcIssuer
1178+
$cluster1 = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName1
1179+
Assert-True {$cluster1.OidcIssuerProfile.Enabled}
1180+
Assert-True {$cluster1.OidcIssuerProfile.IssuerURL.StartsWith("https://eastus.oic.prod-aks.azure.com")}
1181+
1182+
New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2 -NodeCount 1
1183+
$cluster2 = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2
1184+
Assert-False {$cluster2.OidcIssuerProfile.Enabled}
1185+
Assert-Null $cluster2.OidcIssuerProfile.IssuerURL
1186+
1187+
Set-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2 -EnableOidcIssuer
1188+
$cluster2 = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName2
1189+
Assert-True {$cluster2.OidcIssuerProfile.Enabled}
1190+
Assert-True {$cluster2.OidcIssuerProfile.IssuerURL.StartsWith("https://eastus.oic.prod-aks.azure.com")}
1191+
1192+
}
1193+
finally {
1194+
Remove-AzResourceGroup -Name $resourceGroupName -Force
1195+
}
1196+
}
1197+
1198+
function Test-OutboundType {
1199+
# Setup
1200+
$resourceGroupName = Get-RandomResourceGroupName
1201+
$kubeClusterName = Get-RandomClusterName
1202+
$location = 'eastus'
1203+
$nodeVmSize = "Standard_D2_v2"
1204+
1205+
try {
1206+
New-AzResourceGroup -Name $resourceGroupName -Location $location
1207+
1208+
New-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName -NodeVmSize $nodeVmSize -NodeCount 1 -OutboundType managedNATGateway
1209+
$cluster = Get-AzAksCluster -ResourceGroupName $resourceGroupName -Name $kubeClusterName
1210+
Assert-AreEqual 'managedNATGateway' $cluster.NetworkProfile.OutboundType
1211+
}
1212+
finally {
1213+
Remove-AzResourceGroup -Name $resourceGroupName -Force
1214+
}
11641215
}

src/Aks/Aks.Test/SessionRecords/Commands.Aks.Test.ScenarioTests.KubernetesTests/TestEnableOidcIssuer.json

Lines changed: 4499 additions & 0 deletions
Large diffs are not rendered by default.

src/Aks/Aks.Test/SessionRecords/Commands.Aks.Test.ScenarioTests.KubernetesTests/TestOutboundType.json

Lines changed: 2578 additions & 0 deletions
Large diffs are not rendered by default.

src/Aks/Aks/ChangeLog.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
- Additional information about change #1
1919
-->
2020
## Upcoming Release
21+
* Added parameter `-OutboundType` for `New-AzAksCluster`
22+
* Added parameter `-EnableOidcIssuer` for `New-AzAksCluster` and `Set-AzAksCluster`
2123
* Added parameter `-NodePodSubnetID` for `New-AzAksCluster`, `-PodSubnetID` for `New-AzAksNodePool`
2224

2325
## Version 5.3.2

src/Aks/Aks/Commands/NewAzureRmAks.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
using Microsoft.Rest;
3232
using Microsoft.WindowsAzure.Commands.Common;
3333
using Microsoft.WindowsAzure.Commands.Utilities.Common;
34+
using Newtonsoft.Json;
3435

3536
namespace Microsoft.Azure.Commands.Aks
3637
{
@@ -111,6 +112,10 @@ public class NewAzureRmAks : CreateOrUpdateKubeBase
111112
[Parameter(Mandatory = false, HelpMessage = "Docker bridge cidr used for building Kubernetes network.")]
112113
public string DockerBridgeCidr { get; set; }
113114

115+
[Parameter(Mandatory = false, HelpMessage = "The outbound (egress) routing method.")]
116+
[PSArgumentCompleter("loadBalancer", "userDefinedRouting", "managedNATGateway", "userAssignedNATGateway")]
117+
public string OutboundType { get; set; }
118+
114119
[Parameter(Mandatory = false, HelpMessage = "The load balancer sku for the managed cluster.")]
115120
[PSArgumentCompleter("basic", "standard")]
116121
public string LoadBalancerSku { get; set; }
@@ -179,6 +184,9 @@ public class NewAzureRmAks : CreateOrUpdateKubeBase
179184
[Parameter(Mandatory = false, HelpMessage = "The ID of the subnet which pods will join when launched.")]
180185
public string NodePodSubnetID { get; set; }
181186

187+
[Parameter(Mandatory = false, HelpMessage = "Whether to enalbe OIDC issuer feature.")]
188+
public SwitchParameter EnableOidcIssuer { get; set; }
189+
182190
private AcsServicePrincipal acsServicePrincipal;
183191

184192
public override void ExecuteCmdlet()
@@ -429,6 +437,11 @@ private ManagedCluster BuildNewCluster()
429437
managedCluster.ExtendedLocation = new ExtendedLocation(name: EdgeZone, type: "EdgeZone");
430438
}
431439

440+
if (EnableOidcIssuer.IsPresent)
441+
{
442+
managedCluster.OidcIssuerProfile = new ManagedClusterOIDCIssuerProfile(enabled: true);
443+
}
444+
432445
return managedCluster;
433446
}
434447

@@ -459,6 +472,10 @@ private ContainerServiceNetworkProfile GetNetworkProfile()
459472
{
460473
networkProfile.DockerBridgeCidr = DockerBridgeCidr;
461474
}
475+
if (this.IsParameterBound(c => c.OutboundType))
476+
{
477+
networkProfile.OutboundType = OutboundType;
478+
}
462479
networkProfile.LoadBalancerProfile = CreateOrUpdateLoadBalancerProfile(null);
463480

464481
return networkProfile;

src/Aks/Aks/Commands/SetAzureRmAks.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ public class SetAzureRmAks : CreateOrUpdateKubeBase
8080
[Parameter(Mandatory = false, HelpMessage = "Whether to use use Uptime SLA.")]
8181
public SwitchParameter EnableUptimeSLA { get; set; }
8282

83+
[Parameter(Mandatory = false, HelpMessage = "Whether to enalbe OIDC issuer feature.")]
84+
public SwitchParameter EnableOidcIssuer { get; set; }
85+
8386
private ManagedCluster BuildNewCluster()
8487
{
8588
BeforeBuildNewCluster();
@@ -420,6 +423,10 @@ public override void ExecuteCmdlet()
420423
{
421424
cluster.AadProfile = AadProfile;
422425
}
426+
if (EnableOidcIssuer.IsPresent)
427+
{
428+
cluster.OidcIssuerProfile = new ManagedClusterOIDCIssuerProfile(enabled: true);
429+
}
423430
SetIdentity(cluster);
424431

425432
var kubeCluster = this.CreateOrUpdate(ResourceGroupName, Name, cluster);

0 commit comments

Comments
 (0)