Skip to content

Add a Validating Admission Webhook for the ScheduledComplianceScans CRDs#47

Open
AleksandarSavchev wants to merge 8 commits intogardener:mainfrom
AleksandarSavchev:scheduledcompliancescan-webhook
Open

Add a Validating Admission Webhook for the ScheduledComplianceScans CRDs#47
AleksandarSavchev wants to merge 8 commits intogardener:mainfrom
AleksandarSavchev:scheduledcompliancescan-webhook

Conversation

@AleksandarSavchev
Copy link
Copy Markdown
Member

How to categorize this PR?

/area compliance
/kind enhancement

What this PR does / why we need it:
This PR introduces a new validating and mutating webhook for ScheduledComplianceScan resources to the diki-operator.

The mutating webhook does the following defaults for ScheduledComplianceScan resources:

  • spec.schedule = "0 0 * * 0"
  • spec.successfulScansHistoryLimit = 3
  • spec.failedScansHistoryLimit = 1

The validating webhook does the following validation checks for ScheduledComplianceScan resources:

  • checks for correct cron format in spec.schedule
  • check history limits to not be negative integers
  • denies updates to complianceScan template

Which issue(s) this PR fixes:
Fixes #38

Special notes for your reviewer:

Release note:

A webhook validating `ScheduledComplianceScan` resources has been added to the `diki-operator`.
A webhook mutating `ScheduledComplianceScan` resources has been added to the `diki-operator`.

@gardener-prow gardener-prow bot added the area/compliance Compliance related label Apr 16, 2026
@gardener-prow
Copy link
Copy Markdown

gardener-prow bot commented Apr 16, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign aleksandarsavchev for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@gardener-prow gardener-prow bot added kind/enhancement Enhancement, improvement, extension size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. labels Apr 16, 2026
@gardener-prow gardener-prow bot added cla: no Indicates the PR's author has not signed the cla-assistant.io CLA. cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. and removed cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. cla: no Indicates the PR's author has not signed the cla-assistant.io CLA. labels Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/compliance Compliance related cla: yes Indicates the PR's author has signed the cla-assistant.io CLA. kind/enhancement Enhancement, improvement, extension size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ScheduledComplianceScan: Add validating & mutating webhook

1 participant