Repository navigation
Harden OLM serving Secret validation - #3928
sebrandon1 wants to merge 1 commit into
Conversation
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Hi @sebrandon1. Thanks for your PR. I'm waiting for a operator-framework member to verify that this patch is reasonable to test. If it is, they should reply with Regular contributors should join the org to skip this step. Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes.
|
| Layer / File(s) | Summary |
|---|---|
Rotation validation and Secret generation pkg/controller/install/certresources.go |
The controller validates EC private keys against serving certificates, compares CA, certificate, and key fingerprints, stores all three fingerprints, and uses Kubernetes TLS key constants. |
Controller rotation and reuse tests pkg/controller/install/certresources_test.go |
Unit tests cover invalid or mismatched material, changed or missing fingerprints, legacy Secret handling, Secret reuse, and TLS volume mappings. |
Webhook Secret rotation validation test/e2e/webhook_e2e_test.go |
End-to-end tests verify rotation for stale and missing fingerprints, deployment CA hash updates, webhook CA bundle updates, and post-rotation stability. |
Estimated code review effort: 3 (Moderate) | ~30 minutes
Change: Feature
Sequence Diagram(s)
sequenceDiagram
participant WebhookTest
participant ServingSecret
participant OLM
participant Deployment
participant WebhookConfiguration
WebhookTest->>ServingSecret: Replace material or remove fingerprints
OLM->>ServingSecret: Detect invalid or legacy fingerprints
OLM->>ServingSecret: Generate and store new certificate material
OLM->>Deployment: Update CA hash annotation
OLM->>WebhookConfiguration: Update CA bundle
WebhookTest->>ServingSecret: Verify stable fingerprints
Merge Risk: 
Minimal · previous review f6001
-
The change hardens serving Secret validation and rotates invalid or legacy TLS material while updating dependent resources. No concrete merge-blocking risk remains identified.
🚥 Pre-merge checks | ✅ 4 | ❌ 1
-
❌ Failed checks (1 warning)
Check name Status Explanation Resolution Docstring Coverage ⚠️ WarningDocstring coverage is 12.50% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 16 functions across 3 files. Write docstrings for the functions missing them to satisfy the coverage threshold. ✅ Passed checks (4 passed)
-
Check name Status Explanation Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request. Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request. Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled. Title check ✅ Passed The title clearly summarizes the primary change: stronger validation and rotation handling for OLM-managed serving Secrets.
-
Finishing Touches
-
🧪 Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
ℹ️ Recent review info
-
⚙️ Run configuration
-
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID: defaf593-5fba-4abc-89c8-b902c2fab70b
📒 Files selected for processing (3)
-
pkg/controller/install/certresources.go
pkg/controller/install/certresources_test.go
test/e2e/webhook_e2e_test.go
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
ℹ️ Recent review info
-
⚙️ Run configuration
-
Configuration used: defaults
Review profile: CHILL
Plan: Advanced
Run ID:
defaf593-5fba-4abc-89c8-b902c2fab70b
📒 Files selected for processing (3)
-
pkg/controller/install/certresources.gopkg/controller/install/certresources_test.gotest/e2e/webhook_e2e_test.go
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
|
/ok-to-test |
d7d8c23 to
7f84a2d
Compare
7f84a2d to
c2eb5a3
Compare
c2eb5a3 to
3dd9470
Compare
Summary
This PR is a proof of concept for hardening validation of OLM-managed serving Secrets.
POC Behavior
The serving Secret is treated as OLM-controlled after creation. OLM reuses it only when:
Otherwise, OLM generates a new serving Secret. Legacy Secrets without fingerprints rotate once to establish them.
Unit Test Coverage
E2E Validation
Test Plan
Local full e2e execution was limited by an amd64 bundle test image crashing under ARM64 emulation on macOS; the relevant serving-Secret scenarios passed locally.
Summary by CodeRabbit
Bug Fixes
Tests