From 238b94739eade65c8e0d9cfcc714ead080b78672 Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Sat, 17 Jul 2021 21:02:07 +0100 Subject: feat: support in-cluster configuration --- arthur/bot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'arthur/bot.py') 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 {self.user}") -- cgit v1.2.3