From 55c304e9ebd4208a035f3c2d0c8f95e5f9afd5e0 Mon Sep 17 00:00:00 2001 From: Brendan Burns Date: Fri, 12 Aug 2022 22:15:43 +0000 Subject: [PATCH] Add null handling for a missing expiresOn field. --- .../util/authenticators/AzureActiveDirectoryAuthenticator.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java b/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java index c5eff28c3c..bfedca2687 100644 --- a/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java +++ b/util/src/main/java/io/kubernetes/client/util/authenticators/AzureActiveDirectoryAuthenticator.java @@ -50,6 +50,9 @@ public String getToken(Map config) { @Override public boolean isExpired(Map config) { String expiresOn = (String) config.get(EXPIRES_ON); + if (expiresOn == null || expiresOn.length() == 0) { + return true; + } Date expiry = new Date(Long.parseLong(expiresOn) * 1000); return expiry.compareTo(new Date()) <= 0; }