Skip to content

Commit f72e809

Browse files
author
Dieter Bocklandt
committed
feat(K8S-04): mark ComputeClass as cluster-scoped resource
1 parent 02f9263 commit f72e809

File tree

3 files changed

+6
-0
lines changed

3 files changed

+6
-0
lines changed

policy/kubernetes/deny_default_namespace.rego

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ deny_default_namespace contains msg if {
4343
is_mutatingwebhookconfig,
4444
is_podsecuritypolicy,
4545
is_validatingwebhookconfig,
46+
is_computeclass,
4647
]
4748

4849
not valid_namespace

policy/kubernetes/deny_default_namespace_test.rego

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,4 +49,7 @@ test_allow_non_namespaced_kinds if {
4949

5050
validatingwebhookconfig := {"kind": "ValidatingWebhookConfiguration", "metadata": {"name": "test"}}
5151
t.no_errors(deny_default_namespace) with input as validatingwebhookconfig
52+
53+
computeclass := {"kind": "ComputeClass", "metadata": {"name": "test"}}
54+
t.no_errors(deny_default_namespace) with input as computeclass
5255
}

policy/kubernetes/kubernetes.rego

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ is_mutatingwebhookconfig := kind == "MutatingWebhookConfiguration"
4949

5050
is_validatingwebhookconfig := kind == "ValidatingWebhookConfiguration"
5151

52+
is_computeclass := kind == "ComputeClass"
53+
5254
is_job if {
5355
true in [kind == "CronJob", kind == "Job"]
5456
}

0 commit comments

Comments
 (0)