diff --git a/ui/operator_ui/spiloutils.py b/ui/operator_ui/spiloutils.py index d5a181fee..33d07d88a 100644 --- a/ui/operator_ui/spiloutils.py +++ b/ui/operator_ui/spiloutils.py @@ -3,7 +3,7 @@ from datetime import datetime, timezone from furl import furl from json import dumps from logging import getLogger -from os import environ +from os import environ, getenv from requests import Session from urllib.parse import urljoin from uuid import UUID @@ -16,6 +16,8 @@ logger = getLogger(__name__) session = Session() +OPERATOR_CLUSTER_NAME_LABEL = getenv('OPERATOR_CLUSTER_NAME_LABEL', 'cluster-name') + def request(cluster, path, **kwargs): if 'timeout' not in kwargs: @@ -137,7 +139,7 @@ def read_pods(cluster, namespace, spilo_cluster): cluster=cluster, resource_type='pods', namespace=namespace, - label_selector={environ.get('OPERATOR_CLUSTER_NAME_LABEL', 'cluster-name'): spilo_cluster}, + label_selector={OPERATOR_CLUSTER_NAME_LABEL: spilo_cluster}, )