-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Comments
That's fair, however, I think we want the first example policy on the page
to be as simple as possible. Factoring the logic into a helper rule might
be a good idea but it also makes the first example more complicated. What
we can do here is update the test to check for a specific message in the
deny set so that other deny rules don't affect it.
…On Thu, Sep 26, 2019 at 10:01 PM Xiao Li ***@***.***> wrote:
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
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#1794?email_source=notifications&email_token=AAB2KJM57DXXEX7V267NADLQLVSQFA5CNFSM4I3A4BK2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4HOBDJAA>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAB2KJMGSP4JVQY7N7CKFELQLVSQFANCNFSM4I3A4BKQ>
.
--
-Torin
|
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
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:
Test case should looks like:
Actual Behavior
https://play.openpolicyagent.org/p/Zdg4K921Vt
Since all the policy is logical disjunction. If we check test case through
count(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
The text was updated successfully, but these errors were encountered: