diff options
author | 2021-07-17 21:02:07 +0100 | |
---|---|---|
committer | 2021-07-17 21:02:07 +0100 | |
commit | 238b94739eade65c8e0d9cfcc714ead080b78672 (patch) | |
tree | 700e22cfb7210aec27d4e760bbcee791ca184b86 | |
parent | ci: correct stage label (diff) |
feat: support in-cluster configuration
-rw-r--r-- | arthur/bot.py | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/arthur/bot.py b/arthur/bot.py index ebc4391..59ec6f9 100644 --- a/arthur/bot.py +++ b/arthur/bot.py @@ -1,4 +1,5 @@ """Module containing the core bot base for King Arthur.""" +from pathlib import Path from typing import Any from discord.ext import commands @@ -37,7 +38,10 @@ class KingArthur(Bot): DiscordComponents(self) # Authenticate with Kubernetes - await config.load_kube_config() + if Path("~/.kube/config").exists(): + await config.load_kube_config() + else: + await config.load_incluster_config() logger.info(f"Logged in <red>{self.user}</>") |