Skip to content

Add configurable StartupProbe and LivenessProbe to Module CR - #1873

Merged
openshift-merge-bot[bot] merged 1 commit into
rh-ecosystem-edge:mainfrom
TomerNewman:add-livenessprobe-module-cr
Aug 17, 2026
Merged

Add configurable StartupProbe and LivenessProbe to Module CR#1873
openshift-merge-bot[bot] merged 1 commit into
rh-ecosystem-edge:mainfrom
TomerNewman:add-livenessprobe-module-cr

Conversation

@TomerNewman

@TomerNewman TomerNewman commented Aug 11, 2026

Copy link
Copy Markdown
Member

Add optional StartupProbe and LivenessProbe fields to CommonContainerSpec, allowing operators to customize probe timing for DRA and DevicePlugin containers. When nil, falls back to current defaults.


/cc @ybettan
/assign @ybettan
fixes #1871


/hold
until #1874 are merged

Summary by CodeRabbit

  • New Features

    • Added configurable Kubernetes startup and liveness probes for DevicePlugin and DRA containers.
    • Supports exec, gRPC, HTTP, and TCP probe handlers with timing and threshold settings.
    • Custom liveness probes override defaults; startup probes are disabled when unspecified.
  • Validation

    • Added validation preventing probes on DevicePlugin and DRA init containers.

@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for openshift-kmm ready!

Name Link
🔨 Latest commit 3ab1e6a
🔍 Latest deploy log https://app.netlify.com/projects/openshift-kmm/deploys/6a7b199c3163db000881f525
😎 Deploy Preview https://deploy-preview-1873--openshift-kmm.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@openshift-ci
openshift-ci Bot requested a review from ybettan August 11, 2026 12:37
@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: TomerNewman

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

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

CommonContainerSpec now supports optional startup and liveness probes. CRD schemas expose these fields for DevicePlugin and DRA containers. Reconcilers apply the probes, and webhooks reject probes on init containers.

Changes

Container probe configuration

Layer / File(s) Summary
Probe API and CRD contracts
api/v1beta1/module_types.go, api/v1beta1/zz_generated.deepcopy.go, config/crd/..., config/crd-hub/..., bundle/..., bundle-hub/...
CommonContainerSpec adds StartupProbe and LivenessProbe. Generated schemas expose Kubernetes probe configuration for DevicePlugin and DRA containers.
Probe reconciliation and DaemonSet propagation
internal/controllers/device_plugin_reconciler.go, internal/controllers/dra_reconciler.go, internal/controllers/*_test.go
Reconcilers propagate configured probes to containers. DRA keeps its default liveness probe when no override is set. Tests cover default, individual, and combined probe configurations.
Init-container probe validation
internal/webhook/module.go, internal/webhook/module_test.go
Webhook validation rejects startup and liveness probes on DevicePlugin and DRA init containers. Tests cover rejection and probe-free acceptance.

Estimated code review effort: 3 (Moderate) | ~30 minutes

Suggested reviewers: yevgeny-shnaidman

Sequence Diagram(s)

sequenceDiagram
  participant ModuleSpec
  participant Reconciler
  participant DaemonSet
  ModuleSpec->>Reconciler: provide startupProbe and livenessProbe
  Reconciler->>DaemonSet: assign resolved probes to the main container
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes implement the linked upstream commit's configurable probes and address the reported cherry-pick conflict in scope [#1871].
Out of Scope Changes check ✅ Passed All changes support configurable probes, validation, generated CRDs, or tests; no unrelated code is present.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding configurable startup and liveness probes to the Module CR.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@ybettan

ybettan commented Aug 11, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Aug 11, 2026
@ybettan

ybettan commented Aug 11, 2026

Copy link
Copy Markdown
Member

Why do we need to wait for #1872? It is a cherry-pick to the release-2.6 branch.

@TomerNewman
TomerNewman force-pushed the add-livenessprobe-module-cr branch from 528b685 to 4c08cdf Compare August 11, 2026 12:41
@openshift-ci openshift-ci Bot removed the lgtm label Aug 11, 2026
@TomerNewman

Copy link
Copy Markdown
Member Author

Why do we need to wait for #1872? It is a cherry-pick to the release-2.6 branch.

fixed

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
api/v1beta1/module_types.go (1)

303-311: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Init-container probe schemas carry inaccurate descriptions. The LivenessProbe doc comment on the shared CommonContainerSpec names DevicePlugin and DRA default behavior. controller-gen copies that text into the init-container schemas, where the webhook rejects both probes and neither default applies. Neither comment states the init-container restriction.

  • api/v1beta1/module_types.go#L303-L311: remove the reconciler-specific default text from the LivenessProbe comment and state that both probes are rejected on init containers.
  • config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml#L899-L902: regenerate the devicePlugin init-container livenessProbe description from the corrected comment.
  • config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml#L1117-L1120: regenerate the devicePlugin init-container startupProbe description.
  • config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml#L4239-L4242: regenerate the dra init-container livenessProbe description.
  • config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml#L4457-L4460: regenerate the dra init-container startupProbe description.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@api/v1beta1/module_types.go` around lines 303 - 311, Update the
CommonContainerSpec StartupProbe and LivenessProbe documentation so it states
that both probes are rejected on init containers and removes reconciler-specific
default behavior. Regenerate the corresponding descriptions in
config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml at lines 899-902, 1117-1120,
4239-4242, and 4457-4460 for the DevicePlugin and DRA init-container probe
schemas.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@internal/webhook/module_test.go`:
- Around line 445-460: Update the validateModule calls in
internal/webhook/module_test.go lines 445-460 to pass a valid
*version.OCPVersion instead of the undefined version.KubeVersion values, and
replace minValidKubeVersion with the declared minValidOCPVersion at lines
842-865. Use the existing OCP version test value and preserve the current test
assertions.

---

Nitpick comments:
In `@api/v1beta1/module_types.go`:
- Around line 303-311: Update the CommonContainerSpec StartupProbe and
LivenessProbe documentation so it states that both probes are rejected on init
containers and removes reconciler-specific default behavior. Regenerate the
corresponding descriptions in config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml at
lines 899-902, 1117-1120, 4239-4242, and 4457-4460 for the DevicePlugin and DRA
init-container probe schemas.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: eec8602d-b620-4736-b78f-f86ed655f920

📥 Commits

Reviewing files that changed from the base of the PR and between 2180b98 and 528b685.

📒 Files selected for processing (13)
  • api/v1beta1/module_types.go
  • api/v1beta1/zz_generated.deepcopy.go
  • bundle-hub/manifests/hub.kmm.sigs.x-k8s.io_managedclustermodules.yaml
  • bundle/manifests/kmm.sigs.x-k8s.io_modules.yaml
  • config/crd-hub/bases/hub.kmm.sigs.x-k8s.io_managedclustermodules.yaml
  • config/crd-hub/bases/kmm.sigs.x-k8s.io_modules.yaml
  • config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml
  • internal/controllers/device_plugin_reconciler.go
  • internal/controllers/device_plugin_reconciler_test.go
  • internal/controllers/dra_reconciler.go
  • internal/controllers/dra_reconciler_test.go
  • internal/webhook/module.go
  • internal/webhook/module_test.go

Comment thread internal/webhook/module_test.go Outdated
Add optional StartupProbe and LivenessProbe fields to CommonContainerSpec,
allowing operators to customize probe timing for DRA and DevicePlugin
containers. When nil, falls back to current defaults.

Signed-off-by: Anthony Byrne <abyrne@redhat.com>
@TomerNewman
TomerNewman force-pushed the add-livenessprobe-module-cr branch from 4c08cdf to 3ab1e6a Compare August 11, 2026 12:46
@TomerNewman

Copy link
Copy Markdown
Member Author

/retest

@ybettan

ybettan commented Aug 12, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm label Aug 12, 2026
@TomerNewman

Copy link
Copy Markdown
Member Author

/unhold

@TomerNewman

Copy link
Copy Markdown
Member Author

/retest

4 similar comments
@TomerNewman

Copy link
Copy Markdown
Member Author

/retest

@TomerNewman

Copy link
Copy Markdown
Member Author

/retest

@TomerNewman

Copy link
Copy Markdown
Member Author

/retest

@TomerNewman

Copy link
Copy Markdown
Member Author

/retest

@openshift-merge-bot
openshift-merge-bot Bot merged commit 54cd241 into rh-ecosystem-edge:main Aug 17, 2026
22 checks passed
@TomerNewman
TomerNewman deleted the add-livenessprobe-module-cr branch August 17, 2026 09:31
@TomerNewman

Copy link
Copy Markdown
Member Author

/cherry-pick release-2.7

@openshift-cherrypick-robot

Copy link
Copy Markdown

@TomerNewman: new pull request created: #1880

Details

In response to this:

/cherry-pick release-2.7

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Cherry-picking error for aaf031a18d101ecdba85fa4ed20dbc9a598118f0

4 participants