Skip to content

Commit

Permalink
DO NOT MERGE
Browse files Browse the repository at this point in the history
  • Loading branch information
aantn committed Jun 20, 2024
1 parent 99ce16c commit 1fce2a1
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,13 @@ def __init__(
headers |= self.additional_headers

if self.auth_header:
logger.debug("Adding auth_header")
headers |= {"Authorization": self.auth_header}
elif not settings.inside_cluster and self.api_client is not None:
logger.debug("Adding API Server token to Prometheus headers")
self.api_client.update_params_for_auth(headers, {}, ["BearerToken"])

logger.debug(f"Using headers: {headers}")
self.prom_config = generate_prometheus_config(url=self.url, headers=headers, metrics_service=self)
self.prometheus = get_custom_prometheus_connect(self.prom_config)

Expand Down
3 changes: 2 additions & 1 deletion robusta_krr/utils/service_discovery.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,14 +73,15 @@ def find_url(self, selectors: list[str]) -> Optional[str]:
logger.debug(f"Trying to find service with label selector {label_selector}")
service_url = self.find_service_url(label_selector)
if service_url:
logger.debug(f"Found service with label selector {label_selector}")
logger.debug(f"Found service {service_url} with label selector {label_selector}")
self.cache[cache_key] = service_url
return service_url

logger.debug(f"Trying to find ingress with label selector {label_selector}")
self.find_ingress_host(label_selector)
ingress_url = self.find_ingress_host(label_selector)
if ingress_url:
logger.debug(f"Found ingress {ingress_url} with label selector {label_selector}")
return ingress_url

return None
Expand Down

0 comments on commit 1fce2a1

Please sign in to comment.