From dc2dd1a2ab96381d453eae282faba9154c3dd56a Mon Sep 17 00:00:00 2001 From: Adam Dyess Date: Fri, 7 Jun 2024 18:43:01 -0500 Subject: [PATCH] Adjust the failure mode when there's no keystone-auth-service --- src/auth_webhook.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/auth_webhook.py b/src/auth_webhook.py index 8808fd0d..6f4d1018 100644 --- a/src/auth_webhook.py +++ b/src/auth_webhook.py @@ -1,3 +1,4 @@ +import json import logging import os import random @@ -40,9 +41,9 @@ def _uplift_keystone_endpoint() -> str: """Uplift the keystone auth service from a cdk-addons installation.""" try: keystone_auth_service = kubectl_get( - "service", "-n", "kube-system", "k8s-keystone-auth-service" + "service", "-n", "kube-system", "k8s-keystone-auth-service", "--ignore-not-found=true" ) - except CalledProcessError: + except json.JSONDecodeError: log.info("No k8s-keystone-auth-service to uplift") return None labels = keystone_auth_service.get("metadata", {}).get("labels", {})