Skip to content

Commit

Permalink
Merge pull request #320 from redhat-cop/renovate/styrainc-regal-0.x
Browse files Browse the repository at this point in the history
Update dependency StyraInc/regal to v0.25.0
  • Loading branch information
garethahealy authored Aug 19, 2024
2 parents 9f3b3a0 + 7217a38 commit 7a46f1f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/regal-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
# renovate: datasource=github-releases depName=open-policy-agent/opa
OPA_VERSION: v0.67.1
# renovate: datasource=github-releases depName=StyraInc/regal
REGAL_VERSION: v0.24.0
REGAL_VERSION: v0.25.0
steps:
- name: Harden Runner
uses: step-security/harden-runner@5c7944e73c4c2a096b17a9cb74d65b6c2bbafbde # v2.9.1
Expand Down
13 changes: 7 additions & 6 deletions policy/lib/openshift.rego
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import data.lib.konstraint.pods as konstraint_pods
import data.lib.kubernetes

pod := konstraint_pods.pod {
# regal ignore:redundant-existence-check
konstraint_pods.pod
}

Expand Down Expand Up @@ -51,21 +52,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 7a46f1f

Please sign in to comment.