Skip to content

Commit

Permalink
Upgrading extension commands (#20506)
Browse files Browse the repository at this point in the history
  • Loading branch information
yareyes authored Dec 26, 2022
1 parent 08c9663 commit 48c591e
Show file tree
Hide file tree
Showing 8 changed files with 12,944 additions and 9,284 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ public void TestSqlIaaSAKVExtension()

[Fact]
[Trait(Category.AcceptanceType, Category.CheckIn)]
public void TestSqlIaaSExtensionWith2016Image()
public void TestSqlIaaSExtensionWith2017Image()
{
TestRunner.RunTestScript("Test-SetAzureRmVMSqlServerExtensionWith2016Image");
TestRunner.RunTestScript("Test-SetAzureRmVMSqlServerExtensionWith2017Image");
}
}
}
144 changes: 80 additions & 64 deletions src/Compute/Compute.Test/ScenarioTests/SqlIaaSExtensionTests.ps1

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

This file was deleted.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ public class SetAzureSqlServerExtensionCommand : VirtualMachineExtensionBaseCmdl
public override void ExecuteCmdlet()
{
base.ExecuteCmdlet();

bool autoUpgradeMinorVersion = true;

VirtualMachine vm = ComputeClient.ComputeManagementClient.VirtualMachines.Get(this.ResourceGroupName, this.VMName);
if (vm != null && vm.Resources != null)
Expand All @@ -113,6 +113,7 @@ public override void ExecuteCmdlet()
{
this.Name = extension.Name;
this.Version = extension.TypeHandlerVersion;
autoUpgradeMinorVersion = extension.AutoUpgradeMinorVersion ?? autoUpgradeMinorVersion;
}

this.Location = vm.Location;
Expand All @@ -124,6 +125,7 @@ public override void ExecuteCmdlet()
Publisher = VirtualMachineSqlServerExtensionContext.ExtensionPublishedNamespace,
VirtualMachineExtensionType = VirtualMachineSqlServerExtensionContext.ExtensionPublishedType,
TypeHandlerVersion = string.IsNullOrEmpty(this.Version) ? VirtualMachineSqlServerExtensionContext.ExtensionDefaultVersion : this.Version,
AutoUpgradeMinorVersion = autoUpgradeMinorVersion,
Settings = this.GetPublicConfiguration(),
ProtectedSettings = this.GetPrivateConfiguration(),
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class VirtualMachineSqlServerExtensionContext : PSVirtualMachineExtension
/// <summary>
/// SQLVM Extension's default version
/// </summary>
public const string ExtensionDefaultVersion = "1.2";
public const string ExtensionDefaultVersion = "2.0";

/// <summary>
/// Auto-patching settings
Expand Down

0 comments on commit 48c591e

Please sign in to comment.