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

fix(operator): recommended policies deletion logic #1980

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rootxrishabh
Copy link
Contributor

Purpose of PR?:
If a user creates policies with the same name in the recommend policy folder then the operator auto deletes it. The operator should only manage the policies that it owns. This PR fixes that by adding an annotation to all policies created by the operator.

Fixes #

Does this PR introduce a breaking change?

If the changes in this PR are manually verified, list down the scenarios covered::

Additional information for reviewer? :
Mention if this PR is part of any design or a continuation of previous PRs

Checklist:

  • Bug fix. Fixes #
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update
  • PR Title follows the convention of <type>(<scope>): <subject>
  • Commit has unit tests
  • Commit has integration tests

@rootxrishabh
Copy link
Contributor Author

Tested on GKE. Working as expected -

root@rootxrishabh /h/rootxrishabh [1]# k create -f cpol.yaml
kubearmorclusterpolicy.security.kubearmor.com/harden-pkg-mngr-exec created
root@rootxrishabh /h/rootxrishabh# k get kubearmorclusterpolicy
NAME                   AGE
harden-pkg-mngr-exec   5m15s
test                   3h2m

@rootxrishabh rootxrishabh force-pushed the fixDeleteRecommendPolicyLogic branch from 7096dbd to 455a1b1 Compare February 26, 2025 15:26
Signed-off-by: rootxrishabh <[email protected]>
Signed-off-by: Rishabh Soni <[email protected]>
@daemon1024 daemon1024 force-pushed the fixDeleteRecommendPolicyLogic branch from 455a1b1 to 99abefa Compare February 28, 2025 12:00
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 this pull request may close these issues.

2 participants