This is an automated email from the ASF dual-hosted git repository. heneveld pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git
commit 1964e026f95fa2ebc85caa99b912b3c586641f92 Author: Aled Sage <aled.s...@gmail.com> AuthorDate: Thu Jan 24 12:29:09 2019 +0000 Image choice: prefer ubuntu most recent LTS --- .../org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java | 6 ++++-- .../apache/brooklyn/location/jclouds/BrooklynImageChooserTest.java | 6 ++++-- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java index 53102b8..4433e81 100644 --- a/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java +++ b/locations/jclouds/src/main/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooser.java @@ -142,9 +142,11 @@ public class BrooklynImageChooser implements Cloneable { score += punishmentForOldOsVersions(img, OsFamily.UBUNTU, 12); score += 2; - // prefer these LTS releases slightly above others (including above CentOS) + // prefer these LTS releases slightly above others // (but note in AWS Virginia, at least, version is empty for the 14.04 images for some reason, as of Aug 2014) - if ("14.04".equals(os.getVersion())) score += 0.2; + if ("18.04".equals(os.getVersion())) score += 0.4; + else if ("16.04".equals(os.getVersion())) score += 0.3; + else if ("14.04".equals(os.getVersion())) score += 0.2; else if ("12.04".equals(os.getVersion())) score += 0.1; // NB some 13.10 images take 20m+ before they are sshable on AWS diff --git a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooserTest.java b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooserTest.java index fbb488a..b30d34e 100644 --- a/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooserTest.java +++ b/locations/jclouds/src/test/java/org/apache/brooklyn/location/jclouds/BrooklynImageChooserTest.java @@ -108,11 +108,13 @@ public class BrooklynImageChooserTest { } @Test - public void testUbuntu14then12then11() { + public void testUbuntuLts() { assertOrderOfPreference( + getScore(OsFamily.UBUNTU, "18.04"), + getScore(OsFamily.UBUNTU, "16.04"), getScore(OsFamily.UBUNTU, "14.04"), getScore(OsFamily.UBUNTU, "12.04"), - getScore(OsFamily.UBUNTU, "11.04")); + getScore(OsFamily.UBUNTU, "18.10")); } @Test