@Test public void testNoPackageVersionForSb() { Image image = new Image(null, null, null, null, null, null, null, Map.of()); assertFalse(underTest.isFingerprintingSupported(new Json(image))); }
public boolean isFingerprintingSupported(Json image) { if (image == null) { LOGGER.info("Image is null, couldn't verify salt-bootstrap version"); return false; } else { try { Image instanceImage = image.get(Image.class); Map<String, String> packageVersions = instanceImage.getPackageVersions(); if (packageVersions != null) { String saltBootstrapVersion = packageVersions.getOrDefault(PackageVersionChecker.SALT_BOOTSTRAP, "0.0.0"); Versioned currentVersion = () -> StringUtils.substringBefore(saltBootstrapVersion, "-"); LOGGER.debug("Saltboot version in image: {}", currentVersion.getVersion()); return -1 < new VersionComparator().compare(currentVersion, MIN_VERSION); } else { LOGGER.info("PackageVersions is null in image {} {}", instanceImage.getImageId(), instanceImage.getImageName()); return false; } } catch (IOException e) { LOGGER.warn("Couldn't parse image", e); return false; } } }
SaltBootstrapFingerprintVersionChecker { public boolean isFingerprintingSupported(Json image) { if (image == null) { LOGGER.info("Image is null, couldn't verify salt-bootstrap version"); return false; } else { try { Image instanceImage = image.get(Image.class); Map<String, String> packageVersions = instanceImage.getPackageVersions(); if (packageVersions != null) { String saltBootstrapVersion = packageVersions.getOrDefault(PackageVersionChecker.SALT_BOOTSTRAP, "0.0.0"); Versioned currentVersion = () -> StringUtils.substringBefore(saltBootstrapVersion, "-"); LOGGER.debug("Saltboot version in image: {}", currentVersion.getVersion()); return -1 < new VersionComparator().compare(currentVersion, MIN_VERSION); } else { LOGGER.info("PackageVersions is null in image {} {}", instanceImage.getImageId(), instanceImage.getImageName()); return false; } } catch (IOException e) { LOGGER.warn("Couldn't parse image", e); return false; } } } }
SaltBootstrapFingerprintVersionChecker { public boolean isFingerprintingSupported(Json image) { if (image == null) { LOGGER.info("Image is null, couldn't verify salt-bootstrap version"); return false; } else { try { Image instanceImage = image.get(Image.class); Map<String, String> packageVersions = instanceImage.getPackageVersions(); if (packageVersions != null) { String saltBootstrapVersion = packageVersions.getOrDefault(PackageVersionChecker.SALT_BOOTSTRAP, "0.0.0"); Versioned currentVersion = () -> StringUtils.substringBefore(saltBootstrapVersion, "-"); LOGGER.debug("Saltboot version in image: {}", currentVersion.getVersion()); return -1 < new VersionComparator().compare(currentVersion, MIN_VERSION); } else { LOGGER.info("PackageVersions is null in image {} {}", instanceImage.getImageId(), instanceImage.getImageName()); return false; } } catch (IOException e) { LOGGER.warn("Couldn't parse image", e); return false; } } }  }
SaltBootstrapFingerprintVersionChecker { public boolean isFingerprintingSupported(Json image) { if (image == null) { LOGGER.info("Image is null, couldn't verify salt-bootstrap version"); return false; } else { try { Image instanceImage = image.get(Image.class); Map<String, String> packageVersions = instanceImage.getPackageVersions(); if (packageVersions != null) { String saltBootstrapVersion = packageVersions.getOrDefault(PackageVersionChecker.SALT_BOOTSTRAP, "0.0.0"); Versioned currentVersion = () -> StringUtils.substringBefore(saltBootstrapVersion, "-"); LOGGER.debug("Saltboot version in image: {}", currentVersion.getVersion()); return -1 < new VersionComparator().compare(currentVersion, MIN_VERSION); } else { LOGGER.info("PackageVersions is null in image {} {}", instanceImage.getImageId(), instanceImage.getImageName()); return false; } } catch (IOException e) { LOGGER.warn("Couldn't parse image", e); return false; } } }  boolean isFingerprintingSupported(Json image); }
SaltBootstrapFingerprintVersionChecker { public boolean isFingerprintingSupported(Json image) { if (image == null) { LOGGER.info("Image is null, couldn't verify salt-bootstrap version"); return false; } else { try { Image instanceImage = image.get(Image.class); Map<String, String> packageVersions = instanceImage.getPackageVersions(); if (packageVersions != null) { String saltBootstrapVersion = packageVersions.getOrDefault(PackageVersionChecker.SALT_BOOTSTRAP, "0.0.0"); Versioned currentVersion = () -> StringUtils.substringBefore(saltBootstrapVersion, "-"); LOGGER.debug("Saltboot version in image: {}", currentVersion.getVersion()); return -1 < new VersionComparator().compare(currentVersion, MIN_VERSION); } else { LOGGER.info("PackageVersions is null in image {} {}", instanceImage.getImageId(), instanceImage.getImageName()); return false; } } catch (IOException e) { LOGGER.warn("Couldn't parse image", e); return false; } } }  boolean isFingerprintingSupported(Json image);  }