Skip to content

Commit 8043e8b

Browse files
gdamstimja
andauthored
Update basic templates default Java version to JDK 17 (#564)
Co-authored-by: Tim Jacomb <timjacomb1@gmail.com>
1 parent 7b9ec2e commit 8043e8b

10 files changed

Lines changed: 16 additions & 16 deletions

File tree

docs/init-scripts/windows-inbound-agent.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# choco 2.x requires .net 4.8 which is not installed by default and requires a reboot
2+
$env:chocolateyVersion = '1.4.0'
13
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
24

3-
choco install -y adoptopenjdk11
5+
choco install -y temurin17
46

57
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
68

docs/init-scripts/windows-ssh.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# choco 2.x requires .net 4.8 which is not installed by default and requires a reboot
2+
$env:chocolateyVersion = '1.4.0'
13
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
24

3-
choco install -y adoptopenjdk11
5+
choco install -y temurin17
46

57
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
68

src/main/java/com/microsoft/azure/vmagent/AzureVMAgentCleanUpTask.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,8 @@ public void cleanDeployments(long successTimeoutInMinutes, long failTimeoutInMin
269269
deploymentsToClean.add(info);
270270
}
271271
} catch (Exception e) {
272-
LOGGER.log(Level.WARNING, "Failed to get/delete deployment: {0}", e);
272+
LOGGER.log(Level.WARNING, String.format("Failed to get/delete deployment: %s",
273+
info.getDeploymentName()), e);
273274
// Check the number of attempts remaining. If greater than 0, decrement
274275
// and add back into the queue.
275276
if (info.hasAttemptsRemaining()) {

src/main/java/com/microsoft/azure/vmagent/AzureVMAgentTemplate.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -766,8 +766,7 @@ public static String getBasicInitScript(AzureVMAgentTemplate template) {
766766
AzureVMManagementServiceDelegate.PRE_INSTALLED_TOOLS_SCRIPT
767767
.get(builtInImage).get(Constants.INSTALL_GIT));
768768
}
769-
if ((builtInImage.equals(Constants.UBUNTU_1604_LTS)
770-
|| builtInImage.equals(Constants.UBUNTU_2004_LTS)
769+
if ((builtInImage.equals(Constants.UBUNTU_2004_LTS)
771770
|| builtInImage.equals(Constants.UBUNTU_2204_LTS))
772771
&& template.isInstallDocker()) {
773772
stringBuilder.append(getSeparator(template.getOsType()));
@@ -1744,7 +1743,6 @@ public ListBoxModel doFillBuiltInImageItems() {
17441743
ListBoxModel model = new ListBoxModel();
17451744
model.add(Constants.UBUNTU_2204_LTS);
17461745
model.add(Constants.UBUNTU_2004_LTS);
1747-
model.add(Constants.UBUNTU_1604_LTS);
17481746
model.add(Constants.WINDOWS_SERVER_2022);
17491747
model.add(Constants.WINDOWS_SERVER_2019);
17501748
model.add(Constants.WINDOWS_SERVER_2016);

src/main/java/com/microsoft/azure/vmagent/AzureVMManagementServiceDelegate.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,8 +1569,6 @@ private static Map<String, Map<String, String>> getDefaultImageProperties() {
15691569
imageProperties("MicrosoftWindowsServer", "WindowsServer", "2019-Datacenter", "2019-Datacenter-with-Containers", Constants.OS_TYPE_WINDOWS));
15701570
imageProperties.put(Constants.WINDOWS_SERVER_2022,
15711571
imageProperties("MicrosoftWindowsServer", "WindowsServer", "2022-datacenter-azure-edition-core", "2022-datacenter-azure-edition-core", Constants.OS_TYPE_WINDOWS));
1572-
imageProperties.put(Constants.UBUNTU_1604_LTS,
1573-
imageProperties("Canonical", "UbuntuServer", "16.04-LTS", "16.04-LTS", Constants.OS_TYPE_LINUX));
15741572
imageProperties.put(Constants.UBUNTU_2004_LTS,
15751573
imageProperties("canonical", "0001-com-ubuntu-server-focal", "20_04-lts-gen2", "20_04-lts-gen2", Constants.OS_TYPE_LINUX));
15761574
imageProperties.put(Constants.UBUNTU_2204_LTS,
@@ -1602,14 +1600,12 @@ private static Map<String, Map<String, String>> getPreInstalledToolsScript() {
16021600
tools.put(Constants.WINDOWS_SERVER_2016, new HashMap<>());
16031601
tools.put(Constants.WINDOWS_SERVER_2019, new HashMap<>());
16041602
tools.put(Constants.WINDOWS_SERVER_2022, new HashMap<>());
1605-
tools.put(Constants.UBUNTU_1604_LTS, new HashMap<>());
16061603
tools.put(Constants.UBUNTU_2004_LTS, new HashMap<>());
16071604
tools.put(Constants.UBUNTU_2204_LTS, new HashMap<>());
16081605
try {
16091606
windows(Constants.WINDOWS_SERVER_2016, tools);
16101607
windows(Constants.WINDOWS_SERVER_2019, tools);
16111608
windows(Constants.WINDOWS_SERVER_2022, tools);
1612-
ubuntu(Constants.UBUNTU_1604_LTS, tools);
16131609
ubuntu(Constants.UBUNTU_2004_LTS, tools);
16141610
ubuntu(Constants.UBUNTU_2204_LTS, tools);
16151611

src/main/java/com/microsoft/azure/vmagent/util/Constants.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,6 @@ public final class Constants {
128128
public static final String WINDOWS_SERVER_2022 = "Windows Server 2022";
129129
public static final String WINDOWS_SERVER_2019 = "Windows Server 2019";
130130
public static final String WINDOWS_SERVER_2016 = "Windows Server 2016";
131-
public static final String UBUNTU_1604_LTS = "Ubuntu 16.04 LTS";
132131
public static final String UBUNTU_2004_LTS = "Ubuntu 20.04 LTS";
133132
public static final String UBUNTU_2204_LTS = "Ubuntu 22.04 LTS";
134133

src/main/resources/scripts/ubuntuInstallJavaScript.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ set -ex
44

55
# Install Java
66
sudo apt-get -y update
7-
sudo apt-get install -y default-jdk
7+
sudo apt-get install -y openjdk-17-jdk
88

99
java -version

src/main/resources/scripts/windowsInstallJavaScript.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1+
# choco 2.x requires .net 4.8 which is not installed by default and requires a reboot
2+
$env:chocolateyVersion = '1.4.0'
13
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
24

3-
choco install -y adoptopenjdk11
5+
choco install -y temurin17
46

57
$env:Path = [System.Environment]::GetEnvironmentVariable("Path","Machine") + ";" + [System.Environment]::GetEnvironmentVariable("Path","User")
68

src/main/webapp/help-osType.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
Enter an os type of the image family the template is for.<br><br>
33

44
e.g. <b>For the image family</b><br>
5-
&nbsp;&nbsp;&nbsp;&nbsp;1. Ubuntu Server 16.04 LTS: specify &quot;Linux&quot;<br>
6-
&nbsp;&nbsp;&nbsp;&nbsp;2. Windows Server 2016 Datacenter: specify &quot;Windows&quot;<br><br>
5+
&nbsp;&nbsp;&nbsp;&nbsp;1. Ubuntu Server 22.04 LTS: specify &quot;Linux&quot;<br>
6+
&nbsp;&nbsp;&nbsp;&nbsp;2. Windows Server 2019 Datacenter: specify &quot;Windows&quot;<br><br>
77
</div>

src/test/java/com/microsoft/azure/vmagent/IntegrationTest.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -502,7 +502,7 @@ protected VirtualMachine createAzureVM(final String vmName, final String tagName
502502
.withNewPrimaryNetwork("10.0.0.0/28")
503503
.withPrimaryPrivateIPAddressDynamic()
504504
.withoutPrimaryPublicIPAddress()
505-
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_16_04_LTS)
505+
.withPopularLinuxImage(KnownLinuxVirtualMachineImage.UBUNTU_SERVER_20_04_LTS)
506506
.withRootUsername(TestEnvironment.GenerateRandomString(8))
507507
.withRootPassword(TestEnvironment.GenerateRandomString(16) + "AA@@12345@#$%^&*-_!+=[]{}|\\:`,.?/~\\\"();\'") //don't try this at home
508508
.withOSDiskStorageAccountType(StorageAccountTypes.STANDARD_LRS)

0 commit comments

Comments
 (0)