Skip to content

Commit

Permalink
fix: Select the correct context
Browse files Browse the repository at this point in the history
  • Loading branch information
BapRx committed Sep 17, 2022
1 parent 32b8ff4 commit fa8dbbc
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions alert_exporter/sources/kubernetes.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,10 @@ def __init__(self, context: str) -> None:

if context:
logging.info(f"Using context {context}")
self.client = client.CoreV1Api(
api_client=config.new_client_from_config(context=context)
) # FIXME: Wrong context used
print(self.client)
sys.exit(0)
config.load_kube_config(context=context)
else:
logging.info(f"Using context {active_context.get('name')}")
self.client = client.CoreV1Api()
self.client = client.CoreV1Api()

def get_prometheus_rules(self) -> None:
self.rules = []
Expand Down

0 comments on commit fa8dbbc

Please sign in to comment.