diff options
author | Bjørn Christian Seime <bjorncs@oath.com> | 2018-08-13 15:36:23 +0200 |
---|---|---|
committer | Bjørn Christian Seime <bjorncs@oath.com> | 2018-08-13 15:36:23 +0200 |
commit | a379a6dccde8c55f0b7d679c43fb8e7c90fa1563 (patch) | |
tree | cd3f1e37a44fa8a43c301511a23ee39d87baa047 /node-admin | |
parent | 8cb8fe1022c0141bf68f03d40f8580aadb2ed563 (diff) |
Remove return value from AthenzCredentialsMaintainer.converge
Diffstat (limited to 'node-admin')
-rw-r--r-- | node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/identity/AthenzCredentialsMaintainer.java | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/identity/AthenzCredentialsMaintainer.java b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/identity/AthenzCredentialsMaintainer.java index a422a216082..f82047d885c 100644 --- a/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/identity/AthenzCredentialsMaintainer.java +++ b/node-admin/src/main/java/com/yahoo/vespa/hosted/node/admin/maintenance/identity/AthenzCredentialsMaintainer.java @@ -96,14 +96,11 @@ public class AthenzCredentialsMaintainer { this.clock = Clock.systemUTC(); } - /** - * @return Returns true if credentials were updated - */ - public boolean converge() { + public void converge() { try { if (!enabled) { log.debug("Feature disabled on this host - not fetching certificate"); - return false; + return; } log.debug("Checking certificate"); Instant now = clock.instant(); @@ -113,14 +110,14 @@ public class AthenzCredentialsMaintainer { Files.createDirectories(certificateFile.getParent()); Files.createDirectories(identityDocumentFile.getParent()); registerIdentity(); - return true; + return; } X509Certificate certificate = readCertificateFromFile(); Instant expiry = certificate.getNotAfter().toInstant(); if (isCertificateExpired(expiry, now)) { log.info(String.format("Certificate has expired (expiry=%s)", expiry.toString())); registerIdentity(); - return true; + return; } Duration age = Duration.between(certificate.getNotBefore().toInstant(), now); if (shouldRefreshCredentials(age)) { @@ -128,15 +125,14 @@ public class AthenzCredentialsMaintainer { if (shouldThrottleRefreshAttempts(now)) { log.warning(String.format("Skipping refresh attempt as last refresh was on %s (less than %s ago)", lastRefreshAttempt.toString(), REFRESH_BACKOFF.toString())); - return false; + return; } else { lastRefreshAttempt = now; refreshIdentity(); - return true; + return; } } log.debug("Certificate is still valid"); - return false; } catch (IOException e) { throw new UncheckedIOException(e); } |