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

Introduce Enforce flag on Policy CRD #216

Merged
merged 3 commits into from
Dec 18, 2023
Merged

Introduce Enforce flag on Policy CRD #216

merged 3 commits into from
Dec 18, 2023

Conversation

waleedhammam
Copy link
Contributor

Closes #210

What changed?

  • Introduce enforce flag on policy agent CRD to define whether a policy is enforced via the admission controller or just audited for a violation.
  • Remove enabled flag as it's no longer used

Why was this change made?

  • To replace the PolicySet feature

How was this change implemented?

  • Update the CRD to have the new flag and delete the old one
  • Update policy-core package to include the new flag
  • Update internal package to use the new flag
  • Update tests

How did you validate the change?

Release notes

Documentation Changes

@waleedhammam waleedhammam added the enhancement New feature or request label Dec 13, 2023
@codecov-commenter
Copy link

codecov-commenter commented Dec 13, 2023

Codecov Report

Attention: 3 lines in your changes are missing coverage. Please review.

Comparison is base (adbb15f) 78.34% compared to head (b7b0cbe) 78.35%.

Files Patch % Lines
pkg/policy-core/domain/policy_validation.go 66.66% 1 Missing and 1 partial ⚠️
pkg/policy-core/validation/opa_validation.go 75.00% 1 Missing ⚠️

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #216      +/-   ##
==========================================
+ Coverage   78.34%   78.35%   +0.01%     
==========================================
  Files          20       20              
  Lines        1279     1289      +10     
==========================================
+ Hits         1002     1010       +8     
- Misses        211      212       +1     
- Partials       66       67       +1     
Flag Coverage Δ
unit 78.35% <82.35%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Samra10
Samra10 previously approved these changes Dec 18, 2023
Copy link
Member

@Samra10 Samra10 left a comment

Choose a reason for hiding this comment

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

LGTM. ✅

Tested on both cases when Enforce flag is enabled & disabled, and Enforce flag exist on the violation events.

@waleedhammam waleedhammam merged commit 1c286d2 into dev Dec 18, 2023
4 checks passed
@waleedhammam waleedhammam deleted the 210-enforce-flag branch December 18, 2023 14:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Story] Introduce Enforce flag on Policy CRD
3 participants