Skip to content

Commit 6a5cfa7

Browse files
authored
Added validation for namespaces (#349)
1 parent f171a4d commit 6a5cfa7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

robusta_krr/core/models/config.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,11 @@ def validate_namespaces(cls, v: Union[list[str], Literal["*"]]) -> Union[list[st
101101
if v == []:
102102
return "*"
103103

104+
if isinstance(v, list):
105+
for val in v:
106+
if val.startswith("*"):
107+
raise ValueError("Namespace's values cannot start with an asterisk (*)")
108+
104109
return [val.lower() for val in v]
105110

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

0 commit comments

Comments
 (0)