Skip to content

OCPBUGS-77056: Make external cert validation asynchronous (v3 — fix re-admission after secret deletion) - #828

Open
bentito wants to merge 24 commits into
openshift:masterfrom
bentito:OCPBUGS-77056-async-sar-resurrect-v3
Open

OCPBUGS-77056: Make external cert validation asynchronous (v3 — fix re-admission after secret deletion)#828
bentito wants to merge 24 commits into
openshift:masterfrom
bentito:OCPBUGS-77056-async-sar-resurrect-v3

Conversation

@bentito

@bentito bentito commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

> Draft — waiting on revert of #825 (v2) to land before rebase.

Background

This is the fourth attempt at landing asynchronous external certificate validation. PR #825 (v2) fixed the x509: ECDSA verification failure race conditions from #822 but introduced a new regression: 5 out of 10 payload-aggregate runs failed on RouteExternalCertificate tests.

v2 payload results (5/10 — not 10/10)

The /payload-aggregate run for #825 (results) showed 5 successes, 5 failures. The failing runs had two blocking RouteExternalCertificate test failures:

  1. "the secret is deleted then routes are not reachable" — timed out at 900s
  2. "the secret is updated but RBAC permissions are dropped then routes are not reachable" — timed out at 900s

Notably, zero x509 or ECDSA errors appeared anywhere in the logs — the v2 race condition fixes (DeepCopy, atomic PEM write) eliminated those. The new failure mode is a status transition timeout: the route never reaches Admitted=False and the test polls until the 15-minute timeout.

Root cause: SARCompleted re-admits a deleted-secret route

After DeleteFunc rejects a route (Admitted=False, ValidationFailed), the status update triggers a re-enqueue. The subsequent HandleRoute(Modified) call:

  1. DeepCopies the route (capturing Admitted=False in the local copy)
  2. Calls validate() — SAR check passes (RBAC is still valid, only the secret was deleted)
  3. Calls populateRouteTLSFromSecret()GetSecret succeeds because the informer cache hasn't propagated the deletion yet
  4. Plugin chain accepts the route
  5. The SARCompleted guard checks the DeepCopied route, sees Admitted=False (no ext-cert reason), and writes SARCompletedflipping the route back to Admitted=True

The route bounces between Admitted=False (from DeleteFunc) and Admitted=True (from SARCompleted), and the E2E test polls for Admitted=False until timeout.

What's new in this PR (net new vs #825)

One commit on top of the full v2 (#825) changeset:

Fix: check deletedSecrets before writing SARCompleted

Before emitting RecordRouteUpdate(SARCompleted), check p.deletedSecrets.Load(key). If the secret has been marked as deleted by the DeleteFunc, skip the write. This prevents re-admission during the informer cache propagation window.

Test: TestDeletedSecretDoesNotGetReadmitted

Reproduces the exact failure:

  1. Admits a route with an external cert (SARCompleted written)
  2. Fires DeleteFunc (route rejected with ValidationFailed)
  3. Calls HandleRoute(Modified) while GetSecret still succeeds (cache race)
  4. Asserts the route is NOT re-admitted

Fails on v2 code (2 SARCompleted writes = re-admission), passes after the fix.

Test plan

  • go test -race ./pkg/router/controller/ — all pass, including TestDeletedSecretDoesNotGetReadmitted
  • make verify and make check — pass
  • /payload-aggregate-with-prs periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance 20 — target 20/20
  • Scale test: 2000 ext-cert routes admitted in ~120s

🤖 Generated with Claude Code

@openshift-ci-robot openshift-ci-robot added jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 29, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@bentito: This pull request references Jira Issue OCPBUGS-77056, which is invalid:

  • expected the bug to be in one of the following states: NEW, ASSIGNED, POST, but it is ON_QA instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Draft — waiting on revert of #825 (v2) to land before rebase.

Background

This is the fourth attempt at landing asynchronous external certificate validation. PR #825 (v2) fixed the x509: ECDSA verification failure race conditions from #822 but introduced a new regression: 5 out of 10 payload-aggregate runs failed on RouteExternalCertificate tests.

v2 payload results (5/10 — not 10/10)

The /payload-aggregate run for #825 (results) showed 5 successes, 5 failures. The failing runs had two blocking RouteExternalCertificate test failures:

  1. "the secret is deleted then routes are not reachable" — timed out at 900s
  2. "the secret is updated but RBAC permissions are dropped then routes are not reachable" — timed out at 900s

Notably, zero x509 or ECDSA errors appeared anywhere in the logs — the v2 race condition fixes (DeepCopy, atomic PEM write) eliminated those. The new failure mode is a status transition timeout: the route never reaches Admitted=False and the test polls until the 15-minute timeout.

Root cause: SARCompleted re-admits a deleted-secret route

After DeleteFunc rejects a route (Admitted=False, ValidationFailed), the status update triggers a re-enqueue. The subsequent HandleRoute(Modified) call:

  1. DeepCopies the route (capturing Admitted=False in the local copy)
  2. Calls validate() — SAR check passes (RBAC is still valid, only the secret was deleted)
  3. Calls populateRouteTLSFromSecret()GetSecret succeeds because the informer cache hasn't propagated the deletion yet
  4. Plugin chain accepts the route
  5. The SARCompleted guard checks the DeepCopied route, sees Admitted=False (no ext-cert reason), and writes SARCompletedflipping the route back to Admitted=True

The route bounces between Admitted=False (from DeleteFunc) and Admitted=True (from SARCompleted), and the E2E test polls for Admitted=False until timeout.

What's new in this PR (net new vs #825)

One commit on top of the full v2 (#825) changeset:

Fix: check deletedSecrets before writing SARCompleted

Before emitting RecordRouteUpdate(SARCompleted), check p.deletedSecrets.Load(key). If the secret has been marked as deleted by the DeleteFunc, skip the write. This prevents re-admission during the informer cache propagation window.

Test: TestDeletedSecretDoesNotGetReadmitted

Reproduces the exact failure:

  1. Admits a route with an external cert (SARCompleted written)
  2. Fires DeleteFunc (route rejected with ValidationFailed)
  3. Calls HandleRoute(Modified) while GetSecret still succeeds (cache race)
  4. Asserts the route is NOT re-admitted

Fails on v2 code (2 SARCompleted writes = re-admission), passes after the fix.

Test plan

  • go test -race ./pkg/router/controller/ — all pass, including TestDeletedSecretDoesNotGetReadmitted
  • make verify and make check — pass
  • /payload-aggregate-with-prs periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance 20 — target 20/20
  • Scale test: 2000 ext-cert routes admitted in ~120s

🤖 Generated with Claude Code

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 29, 2026
@coderabbitai

coderabbitai Bot commented Jul 29, 2026

Copy link
Copy Markdown
📝 Walkthrough

Walkthrough

The pull request adds shared secret informer management and cache-aware external-certificate SAR validation. It updates route status handling, secret event processing, ingress condition comparison, and related tests. WriterLease gains configurable workers and non-blocking follower scheduling. Debug image builds accept GOARCH, Kubernetes client rate limits increase, certificate writes become atomic, and test setup is adjusted.

Possibly related PRs

  • openshift/router#817: Reintroduces overlapping external-certificate validation and shared secret management changes.
  • openshift/router#822: Contains matching external-certificate validation and shared secret management changes.
  • openshift/router#829: Reverses overlapping external-certificate, status, shared secret, and writer lease changes.

Suggested reviewers: melvinjoseph86, redhat-chai-bot


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 1 warning)

Check name Status Explanation Resolution
Ote Binary Stdout Contract ❌ Error TestMain still writes to stdout via fmt.Println at lines 107/183 and fmt.Printf at line 110; only the flag error at line 70 was redirected to stderr. Change every fmt.Println/Printf in pkg/router/router_test.go TestMain to fmt.Fprintln/Fprintf(os.Stderr, ...), or otherwise ensure diagnostics do not reach stdout.
Docstring Coverage ⚠️ Warning Docstring coverage is 52.78% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (13 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly identifies asynchronous external certificate validation and the secret-deletion re-admission fix.
Description check ✅ Passed The description directly explains the asynchronous validation changes, regression cause, fix, tests, and validation plan.
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.
Stable And Deterministic Test Names ✅ Passed All PR test changes use Go's testing package and Test* functions; no Ginkgo dependencies or It/Describe/Context-style test titles were added.
Test Structure And Quality ✅ Passed The PR adds or updates standard Go tests using testing.T; no Ginkgo imports or Ginkgo DSL constructs occur in the touched test files, so this Ginkgo-specific check is not applicable.
Microshift Test Compatibility ✅ Passed The PR adds only standard Go Test... unit tests; no new Ginkgo e2e tests or MicroShift-incompatible API/resource references were found.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR adds or updates only standard Go unit tests under pkg/; no new Ginkgo e2e tests or multi-node SNO assumptions are present.
Topology-Aware Scheduling Compatibility ✅ Passed The full PR diff adds no pod affinity, topology spread, replica, node selector/affinity, toleration, or PDB constraints; controller scheduling refers only to delayed queue revalidation.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The PR adds only standard Go tests using func Test; no Ginkgo It/Describe/Context/When tests or external-network calls were added.
No-Weak-Crypto ✅ Passed The PR diff adds no MD5, SHA1, DES, RC4, Blowfish, ECB, or weak-crypto API usage; comparisons target secret names or certificate metadata, not secret values.
Container-Privileges ✅ Passed The PR adds no privilege settings or manifest changes. Existing deploy/router.yaml hostNetwork: true is unchanged, and container Dockerfiles use USER 1001.
No-Sensitive-Data-In-Logs ✅ Passed Added logging contains only Kubernetes identifiers, resource versions, worker keys, and file paths; it does not log passwords, tokens, API keys, PII, hostnames, or certificate/key contents.
✨ Finishing Touches
🧪 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.

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 29, 2026
bentito and others added 19 commits July 30, 2026 08:53
This prevents the router from dropping its leader lease under high concurrency when updating route statuses, which was causing a 60-second stall in scale tests.
This commit modifies DeleteFunc inside route_secret_manager.go to transition the route's ingress condition to ExternalCertificateValidationFailed on secret deletion, rather than the transient ExternalCertificateSecretDeleted status.

Reasoning and Analysis:
- The RouteExternalCertificate e2e conformance tests in hypershift expect the route to transition to 'ExternalCertificateValidationFailed' (with ConditionFalse) when a referenced TLS secret is deleted.
- Previously, when DeleteFunc fired, it recorded the intermediate reason 'ExternalCertificateSecretDeleted'. It was expected that the subsequent standard route controller Modified reconciliation would trigger validate(), which would then transition to the final 'ExternalCertificateValidationFailed' reason.
- However, relying on this multi-step watch-triggered transition is race-prone and does not guarantee completion before the test polls.
- By immediately and directly recording 'ExternalCertificateValidationFailed' on secret deletion, we satisfy the E2E test assertion requirements instantly, unblocking hypershift conformance payload nightlies.

Related Changes:
- Updated pkg/router/controller/route_secret_manager_test.go unit tests (TestSecretDelete and TestSecretRecreation) to expect the updated rejection reason.
This commit adds 'system:serviceaccounts', 'system:serviceaccounts:openshift-ingress', and 'system:authenticated' standard service account groups to all SubjectAccessReviewSpecs.

Previously, only the routerServiceAccount name was passed, leading to false-negative denials if permissions are granted via standard service account group roles on the target cluster. Specifying the standard groups ensures complete and correct RBAC evaluation.
…ests

This commit improves testing hygiene in factory_endpointslices_test.go by replacing the global os.Setenv call with t.Setenv.

Using t.Setenv ensures that the KUBE_FEATURE_WatchListClient environment override is automatically scoped and cleanly torn down after each test execution, avoiding potential side effects or pollution on other test suites.
This commit refines the deletion message inside DeleteFunc to say 'external certificate validation failed: secret ... deleted for route ...'

This ensures complete semantic consistency with the ExternalCertificateValidationFailed rejection reason, providing clear and non-contradictory diagnostic information for operators inspecting the route condition.
…ence

This commit updates vendor/modules.txt to remove the reference to github.com/openshift/library-go/pkg/authorization/authorizationutil, which is no longer used by the router following our asynchronous external certificate validation refactoring.
This commit modifies StartFakeServerForTest in pkg/router/template/configmanager/haproxy/testing/haproxy.go to use the pattern 'fake-haproxy-*' instead of combining the long test name in the prefix.

This avoids reaching the hard 104-character limit on Darwin (macOS) Unix socket paths when running local tests, ensuring all tests compile and execute successfully on both macOS and Linux environments.
…ert validation

Three tests that prove the bugs causing the x509: ECDSA verification
failure after PR openshift#822 merged:

1. TestPopulateRouteTLSRace: fails with -race, proving
   populateRouteTLSFromSecret mutates the shared informer cache object
   while the informer goroutine concurrently reads it via DeepCopy.

2. TestWriteCertificateAtomicity: fails consistently, proving
   os.WriteFile truncates the PEM file before writing — concurrent
   readers (HAProxy during reload) observe empty files 3% of the time.

3. TestSARCompletedFeedbackLoop: passes, documenting that every
   HandleRoute unconditionally emits RecordRouteUpdate(SARCompleted),
   creating a re-enqueue loop that doubles cert writes and reloads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…ilure

Three fixes for the bugs that caused the second revert (PR openshift#824):

1. DeepCopy route before mutating TLS fields: HandleRoute now DeepCopies
   the route before populateRouteTLSFromSecret writes Certificate/Key
   in-place. Secret handlers (Add/Update/DeleteFunc) also DeepCopy
   after fetching from the lister. This eliminates the data race between
   the main controller goroutine and informer goroutines that share
   the same route pointer from the informer cache.

2. Atomic PEM file write: WriteCertificate now writes to a temp file
   and renames into place via os.Rename, which is atomic on Linux.
   Previously os.WriteFile truncated the file before writing, creating
   a window where HAProxy could read an empty PEM during reload.

3. Guard SARCompleted feedback loop: Only emit RecordRouteUpdate with
   SARCompleted when the route doesn't already have an ext-cert admitted
   reason. Previously every HandleRoute unconditionally wrote SARCompleted,
   causing a re-enqueue loop that doubled cert writes and HAProxy reloads.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Decouple writerlease worker count from the SAR semaphore. Status writes
to the API server don't need 50 concurrent workers — that level of
parallelism causes a storm of concurrent status writes, leading to
write conflicts and rapid-fire route re-enqueues that widen race
windows. Use a single worker, matching the pre-async behavior.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Test doc comments were written for the "reproduce the bug" commit and
still described pre-fix behavior. Update them to describe the invariants
the tests now protect rather than the bugs they originally exposed.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Address review feedback from jcmoraisjr and coderabbitai: check the
error return from HandleRoute and WriteCertificate in the concurrent
test goroutines instead of silently discarding them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
…t route

After the DeleteFunc handler rejects a route (Admitted=False), the
status update triggers a re-enqueue. If the subsequent HandleRoute
succeeds (because GetSecret still returns the secret from the informer
cache during the deletion propagation window), the SARCompleted guard
would see no ext-cert admitted reason on the DeepCopied route and write
SARCompleted — flipping the route back to Admitted=True. This caused the
E2E test "the secret is deleted then routes are not reachable" to poll
for Admitted=False until the 15-minute timeout.

Fix: check the deletedSecrets map before writing SARCompleted. If the
secret has been marked as deleted by the DeleteFunc, skip the write.

Adds TestDeletedSecretDoesNotGetReadmitted which fails on unfixed code
(2 SARCompleted writes = re-admission) and passes after the fix.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bentito
bentito force-pushed the OCPBUGS-77056-async-sar-resurrect-v3 branch from 7092d0f to 8bb1e1e Compare July 30, 2026 12:53
@bentito
bentito marked this pull request as ready for review July 30, 2026 12:53
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2026
@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcmoraisjr

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 Jul 30, 2026
@bentito

bentito commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

/retest

@bentito

bentito commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

/hold

@openshift-ci openshift-ci Bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jul 30, 2026
Replace the deletedSecrets + hasExtCertAdmittedReason guard with a
simpler approach: track whether validateAndRegister was called in the
current HandleRoute invocation, and only emit SARCompleted when it was.

This means SARCompleted fires on:
- watch.Added (first-time registration)
- watch.Modified when the ext-cert changes (unregister + re-register)
- watch.Modified when ext-cert is newly added to a route

And does NOT fire on:
- watch.Modified re-validation of the same cert (the feedback loop)
- watch.Modified after a secret deletion (the re-admission bug)

The template plugin handles cert/key updates independently via
AddRoute's configsAreEqual check, so cert refreshes reach HAProxy
regardless of whether SARCompleted is emitted.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@openshift-ci openshift-ci Bot removed the lgtm Indicates that a PR is ready to be merged. label Jul 30, 2026
@bentito

bentito commented Jul 30, 2026

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance 10

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

New changes are detected. LGTM label has been removed.

@openshift-ci

openshift-ci Bot commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

@bentito: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/e50bf2a0-8c6f-11f1-93d6-ef7e3591b1bf-0

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. and removed jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Jul 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@bentito: This pull request references Jira Issue OCPBUGS-77056, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @melvinjoseph86

Details

In response to this:

> Draft — waiting on revert of #825 (v2) to land before rebase.

Background

This is the fourth attempt at landing asynchronous external certificate validation. PR #825 (v2) fixed the x509: ECDSA verification failure race conditions from #822 but introduced a new regression: 5 out of 10 payload-aggregate runs failed on RouteExternalCertificate tests.

v2 payload results (5/10 — not 10/10)

The /payload-aggregate run for #825 (results) showed 5 successes, 5 failures. The failing runs had two blocking RouteExternalCertificate test failures:

  1. "the secret is deleted then routes are not reachable" — timed out at 900s
  2. "the secret is updated but RBAC permissions are dropped then routes are not reachable" — timed out at 900s

Notably, zero x509 or ECDSA errors appeared anywhere in the logs — the v2 race condition fixes (DeepCopy, atomic PEM write) eliminated those. The new failure mode is a status transition timeout: the route never reaches Admitted=False and the test polls until the 15-minute timeout.

Root cause: SARCompleted re-admits a deleted-secret route

After DeleteFunc rejects a route (Admitted=False, ValidationFailed), the status update triggers a re-enqueue. The subsequent HandleRoute(Modified) call:

  1. DeepCopies the route (capturing Admitted=False in the local copy)
  2. Calls validate() — SAR check passes (RBAC is still valid, only the secret was deleted)
  3. Calls populateRouteTLSFromSecret()GetSecret succeeds because the informer cache hasn't propagated the deletion yet
  4. Plugin chain accepts the route
  5. The SARCompleted guard checks the DeepCopied route, sees Admitted=False (no ext-cert reason), and writes SARCompletedflipping the route back to Admitted=True

The route bounces between Admitted=False (from DeleteFunc) and Admitted=True (from SARCompleted), and the E2E test polls for Admitted=False until timeout.

What's new in this PR (net new vs #825)

One commit on top of the full v2 (#825) changeset:

Fix: check deletedSecrets before writing SARCompleted

Before emitting RecordRouteUpdate(SARCompleted), check p.deletedSecrets.Load(key). If the secret has been marked as deleted by the DeleteFunc, skip the write. This prevents re-admission during the informer cache propagation window.

Test: TestDeletedSecretDoesNotGetReadmitted

Reproduces the exact failure:

  1. Admits a route with an external cert (SARCompleted written)
  2. Fires DeleteFunc (route rejected with ValidationFailed)
  3. Calls HandleRoute(Modified) while GetSecret still succeeds (cache race)
  4. Asserts the route is NOT re-admitted

Fails on v2 code (2 SARCompleted writes = re-admission), passes after the fix.

Test plan

  • go test -race ./pkg/router/controller/ — all pass, including TestDeletedSecretDoesNotGetReadmitted
  • make verify and make check — pass
  • /payload-aggregate-with-prs periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance 20 — target 20/20
  • Scale test: 2000 ext-cert routes admitted in ~120s

🤖 Generated with Claude Code

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 openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci
openshift-ci Bot requested a review from melvinjoseph86 July 31, 2026 09:02
Two changes to fix the RBAC-revocation conformance test flake:

1. UpdateFunc always calls RecordRouteRejection instead of conditionally
   calling RecordRouteUpdate. This forces the route through a full
   re-validation cycle via HandleRoute. If validate() passes, the
   StatusAdmitter re-admits the route (Admitted=False -> True), which
   triggers a second re-enqueue for another SAR check. If validate()
   fails (RBAC revoked), the route stays rejected.

2. Invalidate the SAR cache after validate() succeeds in the
   re-validation path. This ensures the second evaluation (from the
   rejection->re-admission status cycle) gets a fresh SAR check
   instead of hitting a cached stale result from the first evaluation.

Together these give the router two chances to detect RBAC revocation
with fresh SAR checks, with natural delay between them for RBAC
propagation. Startup performance is unaffected because the SAR cache
is only skipped on the re-validation path (Modified, same cert), not
during initial registration (Added events).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@bentito

bentito commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance 10

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@bentito: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/5ae6c2e0-8cc3-11f1-8f08-ce9c8136127f-0

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@bentito: all tests passed!

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.

@melvinjoseph86

Copy link
Copy Markdown

Marking this as verified based on #825 (comment)
/verified by @mjoseph

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@melvinjoseph86: This PR has been marked as verified by @mjoseph.

Details

In response to this:

Marking this as verified based on #825 (comment)
/verified by @mjoseph

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 openshift-eng/jira-lifecycle-plugin repository.

… re-check

Revert UpdateFunc from RecordRouteRejection back to RecordRouteUpdate
so the route stays Admitted=True during secret updates. The brief
rejection window from the previous approach caused the "secret is
updated then also routes are reachable" test to intermittently fail
because HAProxy served the old cert during the rejection-to-readmission
transition.

Add a delayed goroutine in UpdateFunc that fires 3 seconds after the
secret update, invalidates the SAR cache, and writes a second
RecordRouteUpdate to trigger one more HandleRoute re-evaluation. This
gives the API server's RBAC authorizer time to propagate RoleBinding
deletions before the second SAR check runs. The delayed write is
fire-and-forget with no shared state mutation (lister is read-only,
recorder is mutex-protected).

This satisfies both conformance tests:
- "secret updated, routes reachable": route stays admitted, cert is
  updated immediately via the plugin chain on the first re-enqueue.
- "RBAC dropped": the delayed re-evaluation catches the RBAC revocation
  after propagation, rejecting the route on the second HandleRoute pass.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Jul 31, 2026
@bentito

bentito commented Jul 31, 2026

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance 10

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

@bentito: trigger 1 job(s) for the /payload-(with-prs|job|aggregate|job-with-prs|aggregate-with-prs) command

  • periodic-ci-openshift-hypershift-release-5.0-periodics-e2e-aws-ovn-conformance

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/a217aba0-8d01-11f1-94a2-953804a69f9c-0

@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

🤖 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 `@pkg/router/controller/route_secret_manager.go`:
- Around line 350-367: Replace the per-update sleeping goroutine in the route
revalidation flow with manager-owned cancellable work keyed by route key. Use a
context.Context and timer so shutdown cancels pending revalidation, and coalesce
repeated updates so only the latest scheduled task for each route key can
invalidate the SAR cache and call RecordRouteUpdate. Integrate cancellation and
cleanup with the manager lifecycle while preserving the existing delayed
revalidation behavior.
🪄 Autofix (Beta)

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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: fc3cc82d-1282-4dfc-b6cd-c0aeb49872fb

📥 Commits

Reviewing files that changed from the base of the PR and between 64690b1 and 9465a49.

📒 Files selected for processing (2)
  • pkg/router/controller/route_secret_manager.go
  • pkg/router/controller/route_secret_manager_test.go

Comment thread pkg/router/controller/route_secret_manager.go
@melvinjoseph86

Copy link
Copy Markdown

Marking this as verified based on #825 (comment)
/verified by @mjoseph

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@melvinjoseph86: This PR has been marked as verified by @mjoseph.

Details

In response to this:

Marking this as verified based on #825 (comment)
/verified by @mjoseph

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 openshift-eng/jira-lifecycle-plugin repository.

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. jira/severity-critical Referenced Jira bug's severity is critical for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants