Skip to content

Commit

Permalink
Added validation for namespaces (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
itisallgood authored Oct 24, 2024
1 parent f171a4d commit 6a5cfa7
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions robusta_krr/core/models/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ def validate_namespaces(cls, v: Union[list[str], Literal["*"]]) -> Union[list[st
if v == []:
return "*"

if isinstance(v, list):
for val in v:
if val.startswith("*"):
raise ValueError("Namespace's values cannot start with an asterisk (*)")

return [val.lower() for val in v]

@pd.validator("resources", pre=True)
Expand Down

0 comments on commit 6a5cfa7

Please sign in to comment.