From 3e1f4ec19502fc1740836c47bb40e8f02ff39778 Mon Sep 17 00:00:00 2001 From: LeaveMyYard Date: Fri, 29 Mar 2024 12:13:13 +0200 Subject: Fix trail slash in prometheus url --- robusta_krr/core/models/config.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'robusta_krr') diff --git a/robusta_krr/core/models/config.py b/robusta_krr/core/models/config.py index ac3b15c..aaadaa8 100644 --- a/robusta_krr/core/models/config.py +++ b/robusta_krr/core/models/config.py @@ -80,10 +80,12 @@ class Config(pd.BaseSettings): def validate_prometheus_url(cls, v: Optional[str]): if v is None: return None - + if not v.startswith("https://") and not v.startswith("http://"): raise Exception("--prometheus-url must start with https:// or http://") - + + v = v.removesuffix("/") + return v @pd.validator("prometheus_other_headers", pre=True) -- cgit v1.2.3