From 9f0a2f8a0ce17a7501b812e1880da3a1afffcf78 Mon Sep 17 00:00:00 2001 From: LeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com> Date: Wed, 5 Jul 2023 10:54:06 +0300 Subject: Fix linting errors --- robusta_krr/utils/configurable.py | 4 ++-- robusta_krr/utils/service_discovery.py | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'robusta_krr/utils') diff --git a/robusta_krr/utils/configurable.py b/robusta_krr/utils/configurable.py index 8954139..00c3a64 100644 --- a/robusta_krr/utils/configurable.py +++ b/robusta_krr/utils/configurable.py @@ -93,9 +93,9 @@ class Configurable(abc.ABC): self.echo(message, type="WARNING") - def error(self, message: str = "") -> None: + def error(self, message: str | Exception = "") -> None: """ Echoes an error message to the user """ - self.echo(message, type="ERROR") + self.echo(str(message), type="ERROR") diff --git a/robusta_krr/utils/service_discovery.py b/robusta_krr/utils/service_discovery.py index 42890d3..20138ed 100644 --- a/robusta_krr/utils/service_discovery.py +++ b/robusta_krr/utils/service_discovery.py @@ -1,4 +1,5 @@ from typing import Optional +from abc import ABC, abstractmethod from cachetools import TTLCache from kubernetes import client @@ -82,3 +83,9 @@ class ServiceDiscovery(Configurable): return ingress_url return None + + +class MetricsServiceDiscovery(ServiceDiscovery, ABC): + @abstractmethod + def find_metrics_url(self, *, api_client: Optional[ApiClient] = None) -> Optional[str]: + pass -- cgit v1.2.3