Skip to content

Add support for PriorityClass in FileIntegrity#874

Merged
Vincent056 merged 1 commit intoopenshift:masterfrom
cturiel:master
Apr 16, 2026
Merged

Add support for PriorityClass in FileIntegrity#874
Vincent056 merged 1 commit intoopenshift:masterfrom
cturiel:master

Conversation

@cturiel
Copy link
Copy Markdown
Contributor

@cturiel cturiel commented Jan 12, 2026

Add PriorityClass support to FileIntegrity

This PR adds a priorityClassName field to the FileIntegrity CR so you can set pod priority for the daemon pods.

Why?

In clusters under resource pressure, the file integrity daemon pods may fail to schedule because nodes don't have enough available resources. By setting a PriorityClass, these pods can preempt lower-priority workloads, ensuring they get scheduled and can run successfully on all nodes. PriorityClass documentation

Right now there's no way to control this, so file integrity monitoring can fail on busy nodes.

The compliance-operator already has this feature, so I followed the same pattern. ComplianceAsCode/compliance-operator#71

What changed

API:

  • Added optional priorityClassName field to FileIntegrity spec
  • Updated CRDs and bundle

Controller:

  • Validates PriorityClass exists before applying it
  • Clears invalid values and logs a warning + emits event
  • Detects changes and restarts DaemonSet when needed
  • Added RBAC to read PriorityClass resources

Tests:

  • E2E tests for valid and invalid PriorityClass

Docs:

  • Updated README with example usage
  • Updated CRD descriptions

Example

apiVersion: fileintegrity.openshift.io/v1alpha1
kind: FileIntegrity
metadata:
  name: example-fileintegrity
  namespace: openshift-file-integrity
spec:
  priorityClassName: system-node-critical
  config: {}

Adds an optional priorityClassName field to FileIntegrity spec. When set,
all pods created by the file-integrity operator (daemon pods)
will be launched using the specified PriorityClass.

The operator validates the PriorityClass exists and clears invalid values
to prevent pod creation failures. Includes RBAC permissions, validation
logic, and e2e tests.
@openshift-ci openshift-ci bot requested review from Vincent056 and rhmdnd January 12, 2026 12:39
@openshift-ci openshift-ci bot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jan 12, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Jan 12, 2026

Hi @cturiel. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@xiaojiey
Copy link
Copy Markdown

/ok-to-test

@openshift-ci openshift-ci bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 31, 2026
@xiaojiey
Copy link
Copy Markdown

Pre-merge verification Pass. 3 test scenarios tested. All test scenarios work as expected.

1.  fileintegrity with an invlid priorityclass, the event will be raised:
$ oc get event | grep -i PriorityClass
62s         Warning   PriorityClass         fileintegrity/test-invalid-pc                          Error while getting priority class 'custom-pc-not-exists', PriorityClass not found or invalid
2. fileintegrity with an  priorityclass openshift-user-critical
$ oc get pod aide-test-invalid-pc-4dm46 -o=jsonpath={.spec.priorityClassName}
openshift-user-critical
$ oc get pod aide-test-invalid-pc-4dm46 -o=jsonpath={.spec.priority}
1000000000
3. fileintegrity with a custom priorityclass 
$ oc get pod aide-test-invalid-pc-2xnbl -o=jsonpath={.spec.priority}
1000000
$ oc get pod aide-test-invalid-pc-2xnbl -o=jsonpath={.spec.priorityClassName}
file-integrity-high

@xiaojiey
Copy link
Copy Markdown

/label qe-approved

@openshift-ci openshift-ci bot added the qe-approved Signifies that QE has signed off on this PR label Mar 31, 2026
Copy link
Copy Markdown
Contributor

@Vincent056 Vincent056 left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 15, 2026
@Vincent056
Copy link
Copy Markdown
Contributor

/retest

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cturiel, Vincent056

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

The pull request process is described 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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 15, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 15, 2026

@cturiel: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-bundle-aws-upgrade 9086940 link false /test e2e-bundle-aws-upgrade
ci/prow/e2e-bundle-aws 9086940 link false /test e2e-bundle-aws

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@Vincent056 Vincent056 merged commit a3504e3 into openshift:master Apr 16, 2026
8 of 15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. qe-approved Signifies that QE has signed off on this PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants