forked from mtusi2026/mtusi2026lab7
fix(telemetry): use the operator identity for protected readiness probes
This commit is contained in:
+3
-2
@@ -16,7 +16,8 @@ ENDPOINTS = {
|
||||
|
||||
|
||||
def fetch(service, path, *, params=None, json_result=True):
|
||||
if service == "otel":
|
||||
operator_probe = service == "otel" or path in {"/-/ready", "/ready"}
|
||||
if operator_probe:
|
||||
from scripts.bootstrap_security import OPERATOR, SECRET, write_private
|
||||
|
||||
# Operator credentials can change during CA rollover; never keep a
|
||||
@@ -32,7 +33,7 @@ def fetch(service, path, *, params=None, json_result=True):
|
||||
url += "?" + urlencode(params, doseq=True)
|
||||
code = (
|
||||
f"import urllib.request; from src.security_probe import context; service={service!r}; "
|
||||
f"r=urllib.request.urlopen(urllib.request.Request({url!r},headers={{'Accept':'application/json'}}),timeout=8,context=context('operator' if 'otel' == service else 'grafana')); "
|
||||
f"r=urllib.request.urlopen(urllib.request.Request({url!r},headers={{'Accept':'application/json'}}),timeout=8,context=context({'operator' if operator_probe else 'grafana'!r})); "
|
||||
"print(r.read().decode())"
|
||||
)
|
||||
text = compose(
|
||||
|
||||
Reference in New Issue
Block a user