Skip to content

Commit

Permalink
Adjust the failure mode when there's no keystone-auth-service
Browse files Browse the repository at this point in the history
  • Loading branch information
addyess committed Jun 7, 2024
1 parent f7c9db2 commit dc2dd1a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/auth_webhook.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import json
import logging
import os
import random
Expand Down Expand Up @@ -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", {})
Expand Down

0 comments on commit dc2dd1a

Please sign in to comment.