diff options
| author | LeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com> | 2023-07-05 10:54:06 +0300 |
|---|---|---|
| committer | LeaveMyYard <33721692+LeaveMyYard@users.noreply.github.com> | 2023-07-05 10:54:06 +0300 |
| commit | 9f0a2f8a0ce17a7501b812e1880da3a1afffcf78 (patch) | |
| tree | d7a972974bbe47c7e1cfb59cd48995d652e3dde0 /robusta_krr/utils | |
| parent | 682c2e5f45930f94fc0f2485d62fe536c61417c2 (diff) | |
Fix linting errors
Diffstat (limited to 'robusta_krr/utils')
| -rw-r--r-- | robusta_krr/utils/configurable.py | 4 | ||||
| -rw-r--r-- | robusta_krr/utils/service_discovery.py | 7 |
2 files changed, 9 insertions, 2 deletions
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 |
