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

Fixing CronJob support accross all controls #65

Merged
merged 4 commits into from
Mar 12, 2025

Conversation

slashben
Copy link
Collaborator

This pull request fixes the CronJob support across all controls that already supported CronJobs.

The main changes involve updating the expressions for CronJob resources to ensure they correctly reference the template.spec path. Additionally, new test cases for CronJob resources have been added to the tests.json files.

This fixes #62

Policy Expression Updates:

  • Updated expressions in policy.yaml files for multiple controls to correctly reference object.spec.jobTemplate.spec.template.spec for CronJob resources. This change ensures that the policies are correctly applied to the CronJob resources. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14]

Test Case Additions:

  • Added new test cases in tests.json files for CronJob resources to validate the updated policy expressions. These tests ensure that CronJob resources with specific configurations are correctly allowed or blocked according to the policies. [1] [2] [3] [4]

@slashben slashben requested a review from matthyx March 12, 2025 07:18
matthyx
matthyx previously approved these changes Mar 12, 2025
- Modify memory resource validation to use `quantity().asInteger()` for correct parsing
- Update test cases to use Kubernetes memory unit suffixes (Mi, Gi, Ki)
- Expand memory resource configuration range in default and basic control configurations
- Ensure consistent memory resource validation across Pod, Workload, and CronJob resources

Signed-off-by: Ben <[email protected]>
matthyx
matthyx previously approved these changes Mar 12, 2025
Signed-off-by: Ben <[email protected]>
Signed-off-by: Ben <[email protected]>
@slashben slashben merged commit 038f819 into kubescape:main Mar 12, 2025
5 checks passed
@slashben slashben deleted the fix/support-cronjobs branch March 12, 2025 11:51
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.

C-0044 and C-0062 failling with cronJob
2 participants