From 6fba83cb5afbfbafd2fa0d6ee0b000bd2e7ad0b6 Mon Sep 17 00:00:00 2001 From: lawik974 Date: Tue, 12 Mar 2024 09:52:24 +0100 Subject: [PATCH] No need for context when in cluster --- deployment.yaml | 4 ++-- kube_notify/app.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/deployment.yaml b/deployment.yaml index 64ce2ef..6151476 100644 --- a/deployment.yaml +++ b/deployment.yaml @@ -1,3 +1,4 @@ +--- apiVersion: apps/v1 kind: Deployment metadata: @@ -17,11 +18,10 @@ spec: serviceAccountName: kube-notify-watcher containers: - name: kube-notify - image: wikle/kube-notify:0.1.0 + image: wikle/kube-notify:latest volumeMounts: - name: config mountPath: /app/config.yaml - readonly: true volumes: - name: config configMap: diff --git a/kube_notify/app.py b/kube_notify/app.py index 66edcb5..7e63bb6 100644 --- a/kube_notify/app.py +++ b/kube_notify/app.py @@ -167,9 +167,7 @@ def main(): # Initialize Kubernetes client ioloop = asyncio.get_event_loop() if args.inCluster: - ioloop.run_until_complete( - kubernetes_asyncio.config.load_incluster_config(context=args.context) - ) + ioloop.run_until_complete(kubernetes_asyncio.config.load_incluster_config()) else: ioloop.run_until_complete( kubernetes_asyncio.config.load_kube_config(context=args.context)