Skip to content

Commit ebde8b7

Browse files
authored
fix: correct resource policy to support GPUs and CPUs (#22)
* fix: correct resource policies Signed-off-by: Chris Butler <chris.butler@redhat.com> * chore: release bump Signed-off-by: Chris Butler <chris.butler@redhat.com> * fix: recommended changes Signed-off-by: Chris Butler <chris.butler@redhat.com> * fix: use generalized solution Signed-off-by: Chris Butler <chris.butler@redhat.com> --------- Signed-off-by: Chris Butler <chris.butler@redhat.com>
1 parent f928983 commit ebde8b7

3 files changed

Lines changed: 10 additions & 12 deletions

File tree

Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ keywords:
77
- confidential-containers
88
name: trustee
99
# DO NOT EDIT VERSION HERE, IT IS AUTO-GENERATED BY SEMANTIC-RELEASE
10-
version: 0.3.3
10+
version: 0.3.4

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# trustee
22

3-
![Version: 0.3.3](https://img.shields.io/badge/Version-0.3.3-informational?style=flat-square)
3+
![Version: 0.3.4](https://img.shields.io/badge/Version-0.3.4-informational?style=flat-square)
44

55
A Helm chart to provide an opinionated deployment of Trustee in a validated pattern
66

templates/resource-policy.yaml

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,17 @@ metadata:
88
data:
99
policy.rego: |
1010
package policy
11-
1211
import rego.v1
1312
14-
default allow := false
15-
{{- if not .Values.kbs.gpu.enabled }}
13+
default allow = false
1614
1715
allow if {
18-
input["submods"]["cpu0"]["ear.status"] == "affirming"
19-
}
20-
{{- else }}
16+
not any_not_affirming
17+
count(input.submods) > 0
2118
22-
allow if {
23-
input["submods"]["cpu0"]["ear.status"] == "affirming"
24-
input["submods"]["gpu0"]["ear.status"] == "affirming"
2519
}
26-
{{- end }}
20+
21+
any_not_affirming if {
22+
some _, submod in input.submods
23+
submod["ear.status"] != "affirming"
24+
}

0 commit comments

Comments
 (0)