Commit 075655e
committed
refactor(cli): drop dead fallback in validatePolicyEnforcement
Remove the `len(PolicyEvaluations) == 0 && HasPolicyViolations` backward-compatibility
fallback from validatePolicyEnforcement. Both fields are always produced together by a
single call to getPolicyEvaluations(), so if the evaluations map is empty HasPolicyViolations
is always false — the condition is structurally unreachable.
Flatten the nested `if MustBlockOnPolicyViolations { if bypassPolicyCheck { ... } }` to
a single `if MustBlockOnPolicyViolations && bypassPolicyCheck { ... }` for clarity.
Signed-off-by: Matías Insaurralde <matias@chainloop.dev>1 parent b2ca7e1 commit 075655e
1 file changed
Lines changed: 5 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
194 | 194 | | |
195 | 195 | | |
196 | 196 | | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
206 | | - | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
211 | 202 | | |
212 | 203 | | |
213 | 204 | | |
| |||
0 commit comments