Skip to content

Commit 8b89747

Browse files
authored
Merge pull request #2276 from hatsuyuki15/master
Fix: GCPAuthenticator throws null exception in some cases
2 parents 9bd0ec7 + 859fe0f commit 8b89747

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)