Skip to content

Commit b1c1d70

Browse files
committed
fix: use generalized solution
Signed-off-by: Chris Butler <chris.butler@redhat.com>
1 parent f22ea6e commit b1c1d70

1 file changed

Lines changed: 9 additions & 7 deletions

File tree

templates/resource-policy.yaml

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,17 @@ metadata:
88
data:
99
policy.rego: |
1010
package policy
11+
import rego.v1
12+
1113
default allow = false
14+
1215
allow if {
13-
input.submods.cpu0["ear.status"] == "affirming"
14-
gpu0_ok
16+
not any_not_affirming
17+
count(input.submods) > 0
18+
1519
}
16-
gpu0_ok if {
17-
not input.submods.gpu0
18-
}
1920
20-
gpu0_ok if {
21-
input.submods.gpu0["ear.status"] == "affirming"
21+
any_not_affirming if {
22+
some _, submod in input.submods
23+
submod["ear.status"] != "affirming"
2224
}

0 commit comments

Comments
 (0)