Skip to content

Commit

Permalink
fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
garethahealy committed Aug 19, 2024
1 parent 2808fa9 commit faa0dfc
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions policy/lib/openshift.rego
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@ import data.lib.konstraint.core as konstraint_core
import data.lib.konstraint.pods as konstraint_pods
import data.lib.kubernetes

pod := konstraint_pods.pod {
konstraint_pods.pod
}
pod := konstraint_pods.pod

pod := konstraint_core.resource.spec.template {
is_deploymentconfig
Expand Down Expand Up @@ -51,21 +49,21 @@ is_policy_active(_) {
not konstraint_core.is_gatekeeper
}

is_policy_active(policyId) {
is_policy_active(policy_id) {
# regal ignore:external-reference
konstraint_core.is_gatekeeper

not label_contains(_namespace_disabled_policies_label, policyId)
not label_contains(_namespace_disabled_policies_label, policy_id)
}

label_contains(disabledpolicies, policyId) {
policyId in disabledpolicies
label_contains(disabled_policies, policy_id) {
policy_id in disabled_policies
}

_namespace_disabled_policies_label := disabledpolicies {
_namespace_disabled_policies_label := disabled_policies {
namepace := data.inventory.cluster.v1.Namespace[konstraint_core.resource.metadata.namespace]
label := namepace.metadata.labels["redhat-cop.github.com/gatekeeper-disabled-policies"]
disabledpolicies := split(label, ",")
disabled_policies := split(label, ",")
}

_namespace_disabled_policies_label := [""] {
Expand Down

0 comments on commit faa0dfc

Please sign in to comment.