Skip to content

Commit

Permalink
fix: regex for trusted resource (#420)
Browse files Browse the repository at this point in the history
some apps use CPU_LIMIT, CPU_REQUEST env vars, current regex expects at leas 1 character  after LIMIT/REQUEST keyword

example of env vars in sha-extractor
https://github.com/RedHatInsights/insights-sha-extractor/blob/master/deploy/clowdapp.yaml#L280-L287
  • Loading branch information
psegedy authored Sep 10, 2024
1 parent cfd31f5 commit 6fc3099
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions bonfire/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,10 @@

# regexes used to check for trusted resource request/limit
TRUSTED_REGEX_FOR_PATH = {
"resources.requests.cpu": r"\${(CPU_REQUEST[A-Z0-9_]+)}",
"resources.limits.cpu": r"\${(CPU_LIMIT[A-Z0-9_]+)}",
"resources.requests.memory": r"\${(MEM(?:ORY)?_REQUEST[A-Z0-9_]+)}",
"resources.limits.memory": r"\${(MEM(?:ORY)?_LIMIT[A-Z0-9_]+)}",
"resources.requests.cpu": r"\${(CPU_REQUEST[A-Z0-9_]*)}",
"resources.limits.cpu": r"\${(CPU_LIMIT[A-Z0-9_]*)}",
"resources.requests.memory": r"\${(MEM(?:ORY)?_REQUEST[A-Z0-9_]*)}",
"resources.limits.memory": r"\${(MEM(?:ORY)?_LIMIT[A-Z0-9_]*)}",
}

TRUSTED_CHECK_KINDS = ["ClowdApp", "ClowdJob", "ClowdJobInvocation"]
Expand Down

0 comments on commit 6fc3099

Please sign in to comment.