aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2021-07-17 21:02:07 +0100
committerGravatar Joe Banks <[email protected]>2021-07-17 21:02:07 +0100
commit238b94739eade65c8e0d9cfcc714ead080b78672 (patch)
tree700e22cfb7210aec27d4e760bbcee791ca184b86
parentci: correct stage label (diff)
feat: support in-cluster configuration
-rw-r--r--arthur/bot.py6
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}</>")