OCPBUGS-99207: Prevent empty interface webhook panic #810
All Vouch review confidence checks passed
Residual risk 0.19 = Change Risk (0.47) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.47 · 493 lines diff across 6 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.371
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #810"
general
weight: 0.35
danwinship
Context & Problem Statement
IngressNodeFirewallaccepts an empty interface item such asspec.interfaces: [""]through CRD structural validation. During admission,validateINFInterfaces()records a validation error and then evaluatesinf[0], which panics for the empty string.With the validating webhook configured with
failurePolicy: Fail, the API server returns an opaque admission failure:The invalid resource should be rejected with a field-level validation error and must not cause the webhook to panic.
Fixes OCPBUGS-99207.
Implementation Overview
validateINFInterfaces()to return a validation error andcontinuewhen an interface name is empty.spec.interfaces[index], and rejected interface value for every invalid interface case.interface name must not be empty.failurePolicy: Failand the existing CRD/API contract unchanged.No schema alteration, migration, or environment-variable dependency is introduced.
Trade-offs & Edge Cases
spec.interfaces: [""]remains invalid; it is now rejected cleanly.spec.interfacesand an empty interface list remain rejected by CRD validation.Risk & Blast Radius
Low. The change is limited to invalid interface validation in
validateINFInterfaces().br-exretain existing behavior.failurePolicy: Failis unchanged.Testing & Evidence
The regression test in
pkg/webhook/webhook_suite_test.gocoversinterfaces: [""]and asserts:apierrors.IsInvaliderror;spec.interfaces[0]; andinterface name must not be empty.Local verification completed:
The webhook suite passed all 56 specs with Kubernetes 1.37 envtest assets.
The repository's OpenShift CI configuration exercises this change through:
unit-test— runsmake test, including the webhook regression throughgo test ./...;test-fmt— runsmake fmt;lint— runsmake lint;verify-deps— runs dependency verification;ingress-node-firewall-e2e-metal-ipi— bare-metal IPI on theequinix-ocp-metalprofile with OVN-Kubernetes and dual-stack networking; ande2e-aws-ovn-infw-extension— AWS OVN integration coverage on theaws-5profile.At the time of this update, Prow has not executed these jobs because the PR is awaiting OpenShift
/ok-to-testverification; no Prow result is represented as passed here.No new
test/e2etest is added because this defect is isolated to admission-time validation of a malformed CR. The existing webhook envtest directly exercises the failing API path and verifies the KubernetesInvalidresponse; deployment-level E2E coverage would not add coverage for this code path.Before this change, the reproducer returned the webhook panic shown above. After this change, it returns a normal
InvalidAPI response and does not index an empty interface name.Rollback Plan
Revert the controller image/operator bundle to the previous version. No CRD or data rollback is required.