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

feat: policy timeout protection #389

Merged
merged 8 commits into from
Jan 5, 2023

Conversation

flavio
Copy link
Member

@flavio flavio commented Dec 19, 2022

Ensure a policy cannot run more than a given amount of time.

This is required to fix #254

Note 1: this PR builds on top of #388 to ensure all the tests are passing

Note 2: this PR depends on kubewarden/policy-evaluator#224

@flavio flavio requested a review from a team as a code owner December 19, 2022 15:48
@flavio flavio force-pushed the feat-policy-timeout-protection branch from b0a21c9 to 552192f Compare December 19, 2022 15:49
@flavio flavio self-assigned this Dec 19, 2022
@flavio flavio mentioned this pull request Dec 20, 2022
3 tasks
src/cli.rs Show resolved Hide resolved
@flavio
Copy link
Member Author

flavio commented Dec 22, 2022

@jvanz please, take a look at the latest commits I've pushed. They add the e2e tests

@kravciak this could be interesting for you as well, the commit introducing the e2e tests is 955ac59

Ensure a policy cannot run more than a given amount of time.

This is required to fix kubewarden#254

Signed-off-by: Flavio Castelli <[email protected]>
Allow policy-server to be run in daemon mode. This is useful when
running our end to end tests.

Signed-off-by: Flavio Castelli <[email protected]>
Add e2e tests that:
* start policy-server uncontainerized
* perform different HTTP request against the server, checking their
  responses
* shut down the policy-server instance

Signed-off-by: Flavio Castelli <[email protected]>
@flavio flavio force-pushed the feat-policy-timeout-protection branch from b08b008 to f899ef8 Compare December 22, 2022 20:12
Makefile Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
e2e-tests/01-setup.yml Show resolved Hide resolved
src/main.rs Show resolved Hide resolved
Co-authored-by: José Guilherme Vanz <[email protected]>
Signed-off-by: Flavio Castelli <[email protected]>
Ensure the download directory used by the e2e tests exists

Signed-off-by: Flavio Castelli <[email protected]>
Ensure the following logs are uploaded when the e2e-tests are ran inside
of a GH action:

* venom.log
* policy-server stdout and stderr

Signed-off-by: Flavio Castelli <[email protected]>
Reference published sleep policy, do not load it from local disk

Signed-off-by: Flavio Castelli <[email protected]>
Always run the steps that upload the e2e-test logs, even if the main
e2e-test failed

Signed-off-by: Flavio Castelli <[email protected]>
@flavio
Copy link
Member Author

flavio commented Dec 23, 2022

@jvanz I've applied all the changes requested, plus I've managed to fix the e2e-tests 🥳

Copy link
Member

@viccuad viccuad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, it's super nice to have e2e tests now 🎉 !

(missing consuming correct policy-evaluator repo)

@jvanz jvanz merged commit 6a2b888 into kubewarden:main Jan 5, 2023
@viccuad
Copy link
Member

viccuad commented Jan 5, 2023

This PR got prematurely merged, #396 reverted it.

Moving the PR back to review, so @flavio can have a look at the comments. For merging, it will need a new PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add timeout to policy evaluation
3 participants