Add configurable StartupProbe and LivenessProbe to Module CR - #1873
Conversation
✅ Deploy Preview for openshift-kmm ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Walkthrough
ChangesContainer probe configuration
Estimated code review effort: 3 (Moderate) | ~30 minutes Suggested reviewers: 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
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
🧪 Generate unit tests (beta)
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. Comment |
|
/lgtm |
|
Why do we need to wait for #1872? It is a cherry-pick to the |
528b685 to
4c08cdf
Compare
fixed |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
api/v1beta1/module_types.go (1)
303-311: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winInit-container probe schemas carry inaccurate descriptions. The
LivenessProbedoc comment on the sharedCommonContainerSpecnames 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 theLivenessProbecomment 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-containerlivenessProbedescription from the corrected comment.config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml#L1117-L1120: regenerate the devicePlugin init-containerstartupProbedescription.config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml#L4239-L4242: regenerate the dra init-containerlivenessProbedescription.config/crd/bases/kmm.sigs.x-k8s.io_modules.yaml#L4457-L4460: regenerate the dra init-containerstartupProbedescription.🤖 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
📒 Files selected for processing (13)
api/v1beta1/module_types.goapi/v1beta1/zz_generated.deepcopy.gobundle-hub/manifests/hub.kmm.sigs.x-k8s.io_managedclustermodules.yamlbundle/manifests/kmm.sigs.x-k8s.io_modules.yamlconfig/crd-hub/bases/hub.kmm.sigs.x-k8s.io_managedclustermodules.yamlconfig/crd-hub/bases/kmm.sigs.x-k8s.io_modules.yamlconfig/crd/bases/kmm.sigs.x-k8s.io_modules.yamlinternal/controllers/device_plugin_reconciler.gointernal/controllers/device_plugin_reconciler_test.gointernal/controllers/dra_reconciler.gointernal/controllers/dra_reconciler_test.gointernal/webhook/module.gointernal/webhook/module_test.go
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>
4c08cdf to
3ab1e6a
Compare
|
/retest |
|
/lgtm |
|
/unhold |
|
/retest |
4 similar comments
|
/retest |
|
/retest |
|
/retest |
|
/retest |
54cd241
into
rh-ecosystem-edge:main
|
/cherry-pick release-2.7 |
|
@TomerNewman: new pull request created: #1880 DetailsIn response to this:
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. |
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
Validation