-
Notifications
You must be signed in to change notification settings - Fork 2.9k
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
Support policy with EndpointSelector missing #1987
Conversation
07f740a
to
41c04af
Compare
tests/k8s/tests/04-bad-cnp-import.sh
Outdated
log "importing CNP missing endpointSelector" | ||
k8s_apply_policy kube-system create "${bad_policy_path}" | ||
|
||
log "waiting 2 seconds for the policy to get to cilium-agent" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
k8s_apply_policy
will wait for the policy to be applied
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So it does! our tests also told me to not use sleep ;) so that was handy.
57c886c
to
d1919e4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does the runtime test work locally?
tests/12-policy-import.sh
Outdated
@@ -97,6 +97,14 @@ cat <<EOF | cilium -D policy import - | |||
}] | |||
EOF | |||
|
|||
log "import policy with without an endpointSelector" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/with//
2e29f81
to
96a8d1e
Compare
96a8d1e
to
827e2dd
Compare
OK. finally works. I tested to make sure the test failed without the fix. |
The agent would crash when a bad policy was imported via k8s. This is now rejected, and we have tests to make sure it doesn't happend again. Signed-off-by: Ray Bejjani <[email protected]>
96a8d1e
to
1a1bc0a
Compare
Summary of changes:
If we import a CNP without an endpointSelector cilium-agent crashes.