Skip to content

OCPBUGS-99535: Use public IP on DCM tests#31423

Open
jcmoraisjr wants to merge 1 commit into
openshift:mainfrom
jcmoraisjr:OCPBUGS-99535-use-public-ip
Open

OCPBUGS-99535: Use public IP on DCM tests#31423
jcmoraisjr wants to merge 1 commit into
openshift:mainfrom
jcmoraisjr:OCPBUGS-99535-use-public-ip

Conversation

@jcmoraisjr

@jcmoraisjr jcmoraisjr commented Jul 23, 2026

Copy link
Copy Markdown
Member

DCM tests make requests to the router instance from the router container itself, and uses the loopback interface to reach the proxy. This is failing on environments that configures Squid Proxy, since Squid runs on another pod and cannot reach HAProxy using the loopback interface.

This update is using the public IP address of the router pod, so it works from its own container and also when passing through Squid.

https://redhat.atlassian.net/browse/OCPBUGS-99535

Summary by CodeRabbit

  • Tests
    • Improved router integration test setup by routing requests through an external execution pod and using the router pod’s assigned IP address for resolving the endpoint.
    • Updated request execution and metrics/polling to run in the external execution environment for more consistent behavior.
    • Refined route update allowlist coverage to remove the “allowlist allowed” scenario and retain only the “allowlist denied” case.

@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

@openshift-ci-robot openshift-ci-robot added jira/severity-important Referenced Jira bug's severity is important for the branch this PR is targeting. 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 Jul 23, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@jcmoraisjr: This pull request references Jira Issue OCPBUGS-99535, 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)

Requesting review from QA contact:
/cc @melvinjoseph86

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

Details

In response to this:

DCM tests make requests to the router instance from the router container itself, and uses the loopback interface to reach the proxy. This is failing on environments that configures Squid Proxy, since Squid runs on another pod and cannot reach HAProxy using the loopback interface.

This update is using the public IP address of the router pod, so it works from its own container and also when passing through Squid.

https://redhat.atlassian.net/browse/OCPBUGS-99535

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 23, 2026 17:14
@coderabbitai

coderabbitai Bot commented Jul 23, 2026

Copy link
Copy Markdown

Walkthrough

The router ingress tests now separate router and external execution pods, target the router pod IP, clean up the external pod, update request helpers, and remove the allowlist-allowed case while retaining allowlist-denied coverage.

Changes

Router execution model

Layer / File(s) Summary
Execution pod lifecycle and router addressing
test/extended/router/config_manager_ingress.go
Tracks router and external pod identities separately, uses the router pod IP for addressing, and performs external pod cleanup after each test.
External request execution and route validation
test/extended/router/config_manager.go, test/extended/router/config_manager_ingress.go
Updates URL, metric, and curl execution to run in the external pod and resolve the router directly; removes the allowlist-allowed case and retains the denied case.

Estimated code review effort: 2 (Simple) | ~10 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Test
  participant ExternalExecPod
  participant RouterPod
  Test->>ExternalExecPod: execute curl or metric request
  ExternalExecPod->>RouterPod: connect using router pod IP
  RouterPod-->>ExternalExecPod: return response
  ExternalExecPod-->>Test: return command output
Loading

Possibly related PRs

  • openshift/origin#31352: Refactors related execution pod wiring and router address handling in the router tests.

Suggested reviewers: miheer, gcs278, melvinjoseph86


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
No-Sensitive-Data-In-Logs ❌ Error The metrics curl command embeds router stats creds, and RunHostCmd executes with shell -x while kubectl logs stderr, so the password can be echoed to logs. Avoid tracing this command or pass credentials via a file/env and redact logged command output; do not allow statsPassword to appear in stderr.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning config_manager_ingress.go still sets haproxy.router.openshift.io/ip_allowlist to hardcoded IPv4 10.0.0.1, which is an IPv4-only assumption in a Ginkgo e2e test. Use an IP-family-aware address/CIDR selection (e.g. GetIPAddressFamily()/correctCIDRFamily()) or skip in IPv6-only jobs; add disconnected CI if needed.
✅ Passed checks (13 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and accurately summarizes the main change to DCM tests using the router’s public IP.
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 All Ginkgo titles in the touched files are static literals; no dynamic pod/IP/namespace/date/UUID values appear in It/Describe/Context/When names.
Test Structure And Quality ✅ Passed PASS: The changed ingress tests use BeforeEach/AfterEach cleanup, all cluster waits have timeouts, and the route-update table remains a single related behavior.
Microshift Test Compatibility ✅ Passed No new Ginkgo tests were added; the patch only refactors router request execution and leaves existing MicroShift-sensitive APIs/labels unchanged.
Single Node Openshift (Sno) Test Compatibility ✅ Passed Touched router tests only scale pods and curl the router via its pod IP; no multi-node, node-spread, or HA-only assumptions were found.
Topology-Aware Scheduling Compatibility ✅ Passed Only router extended test helpers changed; no deployment manifests, operators, or controllers, and no new topology-sensitive scheduling constraints were added.
Ote Binary Stdout Contract ✅ Passed No stdout writes were added in process-level code; the changed router files only adjust test setup/helpers and contain no fmt.Print/klog stdout usage in init/Describe setup.
No-Weak-Crypto ✅ Passed Touched files only rewire router/external pod addressing; scans found no md5/sha1/des/rc4/3DES/blowfish/ECB, subtle, or secret comparisons.
Container-Privileges ✅ Passed The PR only changes router test Go code; the commit diff adds no privileged, hostNetwork/PID/IPC, SYS_ADMIN, or allowPrivilegeEscalation settings.
✨ 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-robot

Copy link
Copy Markdown

@jcmoraisjr: This pull request references Jira Issue OCPBUGS-99535, 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:

DCM tests make requests to the router instance from the router container itself, and uses the loopback interface to reach the proxy. This is failing on environments that configures Squid Proxy, since Squid runs on another pod and cannot reach HAProxy using the loopback interface.

This update is using the public IP address of the router pod, so it works from its own container and also when passing through Squid.

https://redhat.atlassian.net/browse/OCPBUGS-99535

Summary by CodeRabbit

  • Tests
  • Improved router integration test configuration by targeting the router pod’s assigned IP address directly.
  • Updated request routing and IP allowlist validation to use the active router endpoint, improving test reliability across network configurations.

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 review from gcs278 and miheer July 23, 2026 17:16
@openshift-ci

openshift-ci Bot commented Jul 23, 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 23, 2026

@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: 2

🤖 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/router/config_manager_ingress.go`:
- Around line 160-166: Update the router pod selection flow before constructing
execPodRef so it polls the selected pod until router.Status.PodIP is non-empty,
refreshing the pod status as needed. Assign execPod only after a valid PodIP is
available, preserving the existing namespace/name and curl --resolve target
behavior.
- Around line 160-166: Separate the router target address from the client IP
used for the allowlist in the execPod setup. Keep execPod.ipAddress for curl’s
--resolve target, and introduce or reuse a distinct value for the observed
proxy/client address when setting haproxy.router.openshift.io/ip_allowlist;
alternatively ensure this allowlist request bypasses the HTTP proxy so the
expected client IP is observed.
🪄 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: 052e837c-287b-4a95-9449-30ee9e0d6de6

📥 Commits

Reviewing files that changed from the base of the PR and between c73a0bb and f39141f.

📒 Files selected for processing (1)
  • test/extended/router/config_manager_ingress.go

Comment thread test/extended/router/config_manager_ingress.go Outdated
@jcmoraisjr
jcmoraisjr force-pushed the OCPBUGS-99535-use-public-ip branch from f39141f to ee4efa8 Compare July 23, 2026 17:40

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

🧹 Nitpick comments (1)
test/extended/router/config_manager_ingress.go (1)

387-388: 🔒 Security & Privacy | 🔵 Trivial | 🏗️ Heavy lift

Keep positive allowlist coverage.

Deleting the allowed case leaves the suite unable to detect regressions that reject legitimate clients. Restore a positive assertion using a deterministic client/source address (or a proxy-bypassing request path), while retaining the router pod IP only as the request destination.

🤖 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 `@test/extended/router/config_manager_ingress.go` around lines 387 - 388,
Restore a positive allowlist assertion in the “check route after adding
annotation - allowlist denied” test case, using a deterministic client/source
address or proxy-bypassing request path that is allowed; keep the router pod IP
only as the request destination and preserve the denied-case coverage.
🤖 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.

Nitpick comments:
In `@test/extended/router/config_manager_ingress.go`:
- Around line 387-388: Restore a positive allowlist assertion in the “check
route after adding annotation - allowlist denied” test case, using a
deterministic client/source address or proxy-bypassing request path that is
allowed; keep the router pod IP only as the request destination and preserve the
denied-case coverage.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 10e6b117-8b83-46f2-85e7-e32d282c1724

📥 Commits

Reviewing files that changed from the base of the PR and between f39141f and ee4efa8.

📒 Files selected for processing (1)
  • test/extended/router/config_manager_ingress.go

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

@gcs278

gcs278 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

/test ?

@gcs278

gcs278 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Here ya go @jcmoraisjr - I think this confirms your fix:

/test e2e-aws-proxy

@jcmoraisjr
jcmoraisjr force-pushed the OCPBUGS-99535-use-public-ip branch from ee4efa8 to 9065689 Compare July 24, 2026 01:26
@jcmoraisjr

Copy link
Copy Markdown
Member Author

/test e2e-aws-proxy

@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

DCM tests make requests to the router instance from the router container
itself, and uses the loopback interface to reach the proxy. This is
failing on environments that configures Squid Proxy, since Squid runs on
another pod, does not use the curl resolution, and does not know the
local hostnames created in the test.

This update is using the public IP address of the router pod and making
requests from an external pod which does not have Squid configured.
Also, execPodRef has now external and router pod references: the former
is used to make requests, the later is used to inspect internal state
of the router.

https://redhat.atlassian.net/browse/OCPBUGS-99535
@jcmoraisjr
jcmoraisjr force-pushed the OCPBUGS-99535-use-public-ip branch from 9065689 to 867705e Compare July 24, 2026 11:49
@jcmoraisjr

Copy link
Copy Markdown
Member Author

/test e2e-aws-proxy

@jcmoraisjr

Copy link
Copy Markdown
Member Author

/test e2e-metal-ipi-ovn

@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

@jcmoraisjr

Copy link
Copy Markdown
Member Author

Number of flakes, mainly infra related, giving another chance.

/retest

@openshift-ci

openshift-ci Bot commented Jul 25, 2026

Copy link
Copy Markdown
Contributor

@jcmoraisjr: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-proxy 867705e link false /test e2e-aws-proxy
ci/prow/e2e-aws-ovn-fips 867705e link true /test e2e-aws-ovn-fips
ci/prow/e2e-gcp-ovn 867705e link true /test e2e-gcp-ovn

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.

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/severity-important Referenced Jira bug's severity is important 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. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants