Skip to content

Commit

Permalink
Fix handling of kubeadm bootstrap token without expiration
Browse files Browse the repository at this point in the history
  • Loading branch information
Tassatux committed Dec 6, 2024
1 parent 6b5401e commit 60752bc
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions plugins/filter/bootstrap_token.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,14 @@ def _token_filter(self, token_list, now=None):
else:
threshold = arrow.utcnow()
for token in token_list:
if (
arrow.get(base64.b64decode(token["data"]["expiration"]).decode("utf-8"))
>= threshold
):
yield token
try:
if (
arrow.get(base64.b64decode(token["data"]["expiration"]).decode("utf-8"))
>= threshold
):
yield token
except KeyError:
continue


if __name__ == "__main__":
Expand Down

0 comments on commit 60752bc

Please sign in to comment.