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

docs:Testing Policies for kubernetes.admission is misleading #1794

Closed
lxlxok opened this issue Sep 27, 2019 · 1 comment · Fixed by #1795
Closed

docs:Testing Policies for kubernetes.admission is misleading #1794

lxlxok opened this issue Sep 27, 2019 · 1 comment · Fixed by #1795

Comments

@lxlxok
Copy link

lxlxok commented Sep 27, 2019

Doc in this page is misleading, https://www.openpolicyagent.org/docs/latest/kubernetes-primer/

Expected Behavior

Test case should not be affected by other policies in the same package.
Policy should looks like:

deny[msg] {  
image_deny
}

image_deny {
......
}

Test case should looks like:

test_image_safety {
...
   image_deny with input as unsafe_image 
}

Actual Behavior

https://play.openpolicyagent.org/p/Zdg4K921Vt

Since all the policy is logical disjunction. If we check test case throughcount(admission.deny) == 1 with input as unsafe_image we might have some problem, even the test case Pass.
Since the test case might be rejected by other policy in the same package kubernetes.admission

@tsandall
Copy link
Member

tsandall commented Sep 27, 2019 via email

tsandall added a commit to tsandall/opa that referenced this issue Sep 27, 2019
Fixes open-policy-agent#1794

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
tsandall added a commit that referenced this issue Sep 27, 2019
Fixes #1794

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants