Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update dependency StyraInc/regal to v0.25.0 #320

Merged
merged 2 commits into from
Aug 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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