Skip to content

OCPBUGS-105874: Avoid TLS port-forward to stale endpoints on degraded TNF clusters. - #31502

Open
eggfoobar wants to merge 1 commit into
openshift:mainfrom
eggfoobar:update-tls-tests-for-tnf
Open

OCPBUGS-105874: Avoid TLS port-forward to stale endpoints on degraded TNF clusters.#31502
eggfoobar wants to merge 1 commit into
openshift:mainfrom
eggfoobar:update-tls-tests-for-tnf

Conversation

@eggfoobar

@eggfoobar eggfoobar commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

When DEGRADED_NODE is set, ForwardPortAndExecute targets a Running pod on a Ready node so TestTLSMinimumVersions/TestTLSDefaults do not follow fenced-node endpoints that still appear Ready.

Summary by CodeRabbit

  • Bug Fixes
    • Improved command execution reliability when a cluster is degraded by routing requests through healthy application instances when available.
    • Added validation to ensure traffic is directed only to ready instances with compatible service configuration.
    • Added graceful fallback to standard service routing when a healthy instance cannot be resolved.
    • Improved error reporting for routing resolution failures.

@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 Aug 11, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@coderabbitai

coderabbitai Bot commented Aug 11, 2026

Copy link
Copy Markdown

Important

Review skipped

No new commits to review since the last review.

⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 46f2b232-a51e-4f46-bf90-24638d9910fc

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: fc5f9004-15e4-4789-b808-e761e4a79b61

📥 Commits

Reviewing files that changed from the base of the PR and between 2a038b0 and d80949b.

📒 Files selected for processing (1)
  • test/extended/util/tls.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/extended/util/tls.go

Walkthrough

ForwardPortAndExecute now resolves a Running, Ready pod on a Ready node during degraded clusters. It uses the Service target port, logs resolution failures, and falls back to forwarding through the Service.

Changes

Degraded-cluster forwarding

Layer / File(s) Summary
Target resolution and port selection
test/extended/util/tls.go
The helper validates the Service selector and port, identifies Ready nodes, and selects the first non-deleting Running and Ready pod on a Ready node.
Forwarding integration
test/extended/util/tls.go
When ClusterDegraded is enabled, ForwardPortAndExecute uses the resolved pod and port. Resolution errors trigger logging and Service fallback.

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

Suggested reviewers: deads2k, p0lyn0mial

Sequence Diagram(s)

sequenceDiagram
  participant ForwardPortAndExecute
  participant TargetResolver
  participant KubernetesAPI
  participant PortForwardRetryFlow
  ForwardPortAndExecute->>TargetResolver: Resolve pod and target port
  TargetResolver->>KubernetesAPI: Query Service, Ready nodes, and matching pods
  KubernetesAPI-->>TargetResolver: Return resolution data
  TargetResolver-->>ForwardPortAndExecute: Return pod and port or error
  ForwardPortAndExecute->>PortForwardRetryFlow: Forward to resolved target or Service
Loading

Caution

Pre-merge checks failed

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

  • Ignore

❌ Failed checks (1 error, 1 inconclusive)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error The new degraded path logs resolveErr with %v; client-go Request.Do returns HTTP client errors directly, which can include the configured API URL and internal hostname. Log only a sanitized error category, or redact URL hosts before passing resolution errors to e2e.Logf.
Ote Binary Stdout Contract ❓ Inconclusive Investigation is still in progress. Need inspect e2e.Logf and OTE suite setup to verify whether new process-level logging writes JSON-corrupting stdout.
✅ Passed checks (13 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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 The PR changes only test/extended/util/tls.go; added code has no Ginkgo title declarations or title construction, and TLS caller titles remain unchanged static strings.
Test Structure And Quality ✅ Passed The PR changes only a utility helper, not Ginkgo It blocks. New Kubernetes reads use a 30-second context timeout, and no resources, waits, or assertions were added.
Microshift Test Compatibility ✅ Passed The patch changes only test/extended/util/tls.go and adds no Ginkgo test declarations or MicroShift-incompatible test APIs or features.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR diff changes only test/extended/util/tls.go and adds no Ginkgo It, Describe, Context, or When tests; the SNO test compatibility check is not applicable.
Topology-Aware Scheduling Compatibility ✅ Passed HEAD changes only test/extended/util/tls.go. The added code reads Services, Nodes, and Pods for port forwarding; it adds no deployment, replica, affinity, spread, selector, taint, or PDB scheduling...
Ipv6 And Disconnected Network Test Compatibility ✅ Passed The commit changes only a TLS utility, adds no Ginkgo test declarations, IPv4-specific literals or parsing, public URLs, or external connectivity.
No-Weak-Crypto ✅ Passed The changed tls.go code contains no weak-crypto primitives or custom cryptographic implementation; math/rand selects a local port and is not used for secrets or tokens.
Container-Privileges ✅ Passed The diff changes only test/extended/util/tls.go. Added Go logic contains no privileged, hostPID/hostNetwork/hostIPC, SYS_ADMIN, or allowPrivilegeEscalation manifest settings.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: avoiding TLS port-forwarding to stale endpoints on degraded TNF clusters.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@eggfoobar

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-degraded

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

@eggfoobar: it appears that you have attempted to use some version of the payload command, but your comment was incorrectly formatted and cannot be acted upon. See the docs for usage info.

@eggfoobar

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-degraded 2

@openshift-ci

openshift-ci Bot commented Aug 11, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-degraded

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/257e8f40-958b-11f1-95e4-356eb7bec005-0

@openshift-ci
openshift-ci Bot requested review from deads2k and p0lyn0mial August 11, 2026 13:47

@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 `@test/extended/util/tls.go`:
- Around line 124-131: Update the pod selection loop to require a true PodReady
condition in addition to PodRunning before returning the pod and targetPort. Use
the pod’s status conditions to reject non-ready pods, ensuring the retry loop
does not repeatedly select the first non-ready pod.
🪄 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: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 32fecd0b-6097-42e7-9198-607254a77718

📥 Commits

Reviewing files that changed from the base of the PR and between 29be8bd and 2a038b0.

📒 Files selected for processing (1)
  • test/extended/util/tls.go

Comment thread test/extended/util/tls.go
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

When DEGRADED_NODE is set, ForwardPortAndExecute targets a Running pod on a Ready node so TestTLSMinimumVersions/TestTLSDefaults do not follow fenced-node endpoints that still appear Ready.

Co-authored-by: Cursor <cursoragent@cursor.com>
Signed-off-by: ehila <ehila@redhat.com>
@eggfoobar
eggfoobar force-pushed the update-tls-tests-for-tnf branch from 2a038b0 to d80949b Compare August 12, 2026 09:43
@eggfoobar eggfoobar changed the title WIP: Avoid TLS port-forward to stale endpoints on degraded TNF clusters. OCPBUGS-105874: Avoid TLS port-forward to stale endpoints on degraded TNF clusters. Aug 12, 2026
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Aug 12, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@eggfoobar: This pull request references Jira Issue OCPBUGS-105874, which is valid. The bug has been moved to the POST state.

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 New, which is one of the valid states (NEW, ASSIGNED, POST)

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

Details

In response to this:

When DEGRADED_NODE is set, ForwardPortAndExecute targets a Running pod on a Ready node so TestTLSMinimumVersions/TestTLSDefaults do not follow fenced-node endpoints that still appear Ready.

Summary by CodeRabbit

  • Bug Fixes
  • Improved command execution reliability when a cluster is degraded by routing requests through healthy application instances when available.
  • Added validation to ensure traffic is directed only to ready instances with compatible service configuration.
  • Added graceful fallback to standard service routing when a healthy instance cannot be resolved.
  • Improved error reporting for routing resolution failures.

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 removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 12, 2026
@eggfoobar

Copy link
Copy Markdown
Contributor Author

/payload-aggregate periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-degraded 2

@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-degraded

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/0e0747e0-9634-11f1-991b-041f87e0886d-0

@fracappa fracappa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Aug 12, 2026
@eggfoobar

Copy link
Copy Markdown
Contributor Author

@coderabbitai re-review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown

@eggfoobar, I will re-review the changes.

⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@eggfoobar

Copy link
Copy Markdown
Contributor Author

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
⚠️ Action not completed

Already reviewed.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@eggfoobar

Copy link
Copy Markdown
Contributor Author

@coderabbitai resolve

@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
✅ Action performed

Comments resolved and changes approved.

@openshift-ci openshift-ci Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label Aug 12, 2026
@YamunadeviShanmugam

Copy link
Copy Markdown
Contributor

/lgtm

@neisw

neisw commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: eggfoobar, fracappa, neisw, YamunadeviShanmugam

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 Aug 12, 2026
@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

@eggfoobar: 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.

@eggfoobar

Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-degraded

@openshift-ci

openshift-ci Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-degraded

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/71dded70-9691-11f1-91c5-ba1324835cfe-0

@eggfoobar

Copy link
Copy Markdown
Contributor Author

/payload-job periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-degraded

@openshift-ci

openshift-ci Bot commented Aug 13, 2026

Copy link
Copy Markdown
Contributor

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

  • periodic-ci-openshift-release-main-nightly-5.0-e2e-metal-ovn-two-node-fencing-degraded

See details on https://pr-payload-tests.ci.openshift.org/runs/ci/7b31d3d0-9710-11f1-8721-333c4ad27fef-0

@eggfoobar

Copy link
Copy Markdown
Contributor Author

/verified by CI

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

Copy link
Copy Markdown

@eggfoobar: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

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. 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. lgtm Indicates that a PR is ready to be merged. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants