From a005d7ef94e92e5651187586466812803f7ed91f Mon Sep 17 00:00:00 2001 From: LeaveMyYard Date: Tue, 2 Apr 2024 17:34:49 +0300 Subject: Hotfix for error when running in cluster --- robusta_krr/core/models/config.py | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3