File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
kubernetes-client/src/Kubernetes/Client/Auth Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -62,8 +62,8 @@ getToken g@(GCPAuth{..}) = getCurrentToken g
62
62
getCurrentToken :: GCPAuth -> IO (Maybe Text )
63
63
getCurrentToken (GCPAuth {.. }) = do
64
64
now <- getCurrentTime
65
- maybeExpiry <- atomically $ readTVar gcpTokenExpiry
66
- maybeToken <- atomically $ readTVar gcpAccessToken
65
+ maybeExpiry <- readTVarIO gcpTokenExpiry
66
+ maybeToken <- readTVarIO gcpAccessToken
67
67
return $ do
68
68
expiry <- maybeExpiry
69
69
if expiry > now
@@ -80,8 +80,9 @@ fetchToken GCPAuth{..} = do
80
80
expText = runJSONPath gcpExpiryKey =<< credsJSON
81
81
expiry :: Either Text (Maybe UTCTime )
82
82
expiry = Just <$> (parseExpiryTime =<< expText)
83
- atomically $ writeTVar gcpAccessToken (rightToMaybe token)
84
- atomically $ writeTVar gcpTokenExpiry (either (const Nothing ) id expiry)
83
+ atomically $ do
84
+ writeTVar gcpAccessToken (rightToMaybe token)
85
+ writeTVar gcpTokenExpiry (either (const Nothing ) id expiry)
85
86
return token
86
87
87
88
parseGCPAuthInfo :: Map Text Text -> IO (Either Text GCPAuth )
You can’t perform that action at this time.
0 commit comments