mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-05 18:13:07 +02:00
populate cluster label in spiloutils
This commit is contained in:
@@ -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},
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user