summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeaveMyYard <zhukovpavel2001@gmail.com>2024-04-02 17:34:49 +0300
committerLeaveMyYard <zhukovpavel2001@gmail.com>2024-04-02 17:34:49 +0300
commita005d7ef94e92e5651187586466812803f7ed91f (patch)
treebd9e2becb84398101c6686122459aa51e2978b0c
parentc6a5bf767279ad8ba97640ead4460e31ad00a03e (diff)
Hotfix for error when running in cluster
-rw-r--r--robusta_krr/core/models/config.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/robusta_krr/core/models/config.py b/robusta_krr/core/models/config.py
index aaadaa8..d4f04a0 100644
--- a/robusta_krr/core/models/config.py
+++ b/robusta_krr/core/models/config.py
@@ -146,6 +146,9 @@ class Config(pd.BaseSettings):
self.inside_cluster = True
def get_kube_client(self, context: Optional[str] = None):
+ if context is None:
+ return None
+
api_client = config.new_client_from_config(context=context, config_file=self.kubeconfig)
if self.impersonate_user is not None:
# trick copied from https://github.com/kubernetes-client/python/issues/362