Skip to content

Commit 859fe0f

Browse files
authored
Fix: GCPAuthenticator throws null exception in some cases
1 parent 9bd0ec7 commit 859fe0f

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

util/src/main/java/io/kubernetes/client/util/authenticators/GCPAuthenticator.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ public Map<String, Object> refresh(Map<String, Object> config) {
9999
String[] scopes = parseScopes(config);
100100
try {
101101
if (this.gc == null) this.gc = GoogleCredentials.getApplicationDefault().createScoped(scopes);
102+
gc.refreshIfExpired();
102103
AccessToken accessToken = gc.getAccessToken();
103104
config.put(ACCESS_TOKEN, accessToken.getTokenValue());
104105
config.put(EXPIRY, accessToken.getExpirationTime());

0 commit comments

Comments
 (0)