Skip to content
This repository was archived by the owner on Mar 13, 2022. It is now read-only.

Bugfix Azure AD auth config field 'expired-on': checking an int against time.struct_time #121

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion config/kube_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,10 @@ def _load_azure_token(self, provider):
if 'access-token' not in provider['config']:
return
if 'expires-on' in provider['config']:
if int(provider['config']['expires-on']) < time.gmtime():
expires_on_ts = int(provider['config']['expires-on'])
expires_on = time.gmtime(expires_on_ts)
now = time.gmtime()
if expires_on < now:
self._refresh_azure_token(provider['config'])
self.token = 'Bearer %s' % provider['config']['access-token']
return self.token
Expand Down