diff options
| author | LeaveMyYard <zhukovpavel2001@gmail.com> | 2024-03-29 12:13:13 +0200 |
|---|---|---|
| committer | LeaveMyYard <zhukovpavel2001@gmail.com> | 2024-03-29 12:13:13 +0200 |
| commit | 3e1f4ec19502fc1740836c47bb40e8f02ff39778 (patch) | |
| tree | c099fe80a5b43fb10b7becfe658c747c8e00eb3f /robusta_krr | |
| parent | be90947b49afa7e69b8024758bb18824d466d34e (diff) | |
Fix trail slash in prometheus url
Diffstat (limited to 'robusta_krr')
| -rw-r--r-- | robusta_krr/core/models/config.py | 6 |
1 files changed, 4 insertions, 2 deletions
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) |
