Skip to content

OCPBUGS-100332: fix(konnectivity): conditionally prefer IPv4 based on HCP network config [release-4.22] - #9191

Open
vsolanki12 wants to merge 1 commit into
openshift:release-4.22from
vsolanki12:backport-9140-to-release-4.22
Open

OCPBUGS-100332: fix(konnectivity): conditionally prefer IPv4 based on HCP network config [release-4.22]#9191
vsolanki12 wants to merge 1 commit into
openshift:release-4.22from
vsolanki12:backport-9140-to-release-4.22

Conversation

@vsolanki12

Copy link
Copy Markdown
Contributor

Summary

Backport of #9140 to release-4.22.

  • Adds --prefer-ipv4 flag to konnectivity HTTPS and SOCKS5 proxy containers
  • Automatically enables IPv4 preference for single-stack IPv4 HCPs on dual-stack management clusters
  • Prevents DNS resolution from returning IPv6 addresses that single-stack IPv4 data planes cannot reach

Conflict resolution

support/netutil package doesn't exist on release-4.22. Changed netutil.IsIPv4CIDR to util.IsIPv4CIDR which provides the same function on this branch.

Test plan

  • go build passes for affected packages
  • go vet clean
  • 46 unit tests pass in support/konnectivityproxy

Single-stack IPv4 KubeVirt hosted clusters on dual-stack management
clusters fail to reach external services (e.g. OAuth IDPs) because the
konnectivity proxy resolver picks IPv6 addresses that are unreachable
from the single-stack data plane.

Instead of always preferring IPv4, detect the IP family from the HCP
ServiceNetwork CIDRs and pass --prefer-ipv4 to the konnectivity proxy
sidecars only when the hosted cluster is single-stack IPv4. This ensures
dual-stack and IPv6-only HCPs are unaffected.

The CPO sidecar injection auto-detects the network configuration via
isSingleStackIPv4() and sets the flag automatically — no per-component
manual configuration needed.

Signed-off-by: Vimal Solanki <vsolanki@redhat.com>
@openshift-ci-robot openshift-ci-robot added 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 31, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@vsolanki12: This pull request references Jira Issue OCPBUGS-100332, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected dependent Jira Issue OCPBUGS-86843 to target a version in 5.0.0, but it targets "5.0" 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:

Summary

Backport of #9140 to release-4.22.

  • Adds --prefer-ipv4 flag to konnectivity HTTPS and SOCKS5 proxy containers
  • Automatically enables IPv4 preference for single-stack IPv4 HCPs on dual-stack management clusters
  • Prevents DNS resolution from returning IPv6 addresses that single-stack IPv4 data planes cannot reach

Conflict resolution

support/netutil package doesn't exist on release-4.22. Changed netutil.IsIPv4CIDR to util.IsIPv4CIDR which provides the same function on this branch.

Test plan

  • go build passes for affected packages
  • go vet clean
  • 46 unit tests pass in support/konnectivityproxy

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.

@coderabbitai

coderabbitai Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: bec3e123-e03e-476d-8205-a2cf6535c2d8

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

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-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: LGTM mode

@openshift-ci
openshift-ci Bot requested review from bryan-cox and csrwng July 31, 2026 06:00
@openshift-ci openshift-ci Bot added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release and removed do-not-merge/needs-area labels Jul 31, 2026
@codecov

codecov Bot commented Jul 31, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 48.57143% with 36 lines in your changes missing coverage. Please review.
✅ Project coverage is 36.23%. Comparing base (f4bf3e3) to head (6abefee).

Files with missing lines Patch % Lines
support/konnectivityproxy/resolver.go 45.65% 25 Missing ⚠️
...t/controlplane-component/konnectivity-container.go 65.00% 7 Missing ⚠️
support/konnectivityproxy/dialer.go 0.00% 2 Missing ⚠️
konnectivity-https-proxy/cmd.go 0.00% 1 Missing ⚠️
konnectivity-socks5-proxy/main.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@               Coverage Diff                @@
##           release-4.22    #9191      +/-   ##
================================================
+ Coverage         36.22%   36.23%   +0.01%     
================================================
  Files               774      774              
  Lines             94889    94950      +61     
================================================
+ Hits              34374    34408      +34     
- Misses            57699    57726      +27     
  Partials           2816     2816              
Files with missing lines Coverage Δ
konnectivity-https-proxy/cmd.go 10.28% <0.00%> (-0.06%) ⬇️
konnectivity-socks5-proxy/main.go 0.00% <0.00%> (ø)
support/konnectivityproxy/dialer.go 29.21% <0.00%> (-0.23%) ⬇️
...t/controlplane-component/konnectivity-container.go 37.18% <65.00%> (+3.10%) ⬆️
support/konnectivityproxy/resolver.go 13.12% <45.65%> (+13.12%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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

@vsolanki12

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@vsolanki12: This pull request references Jira Issue OCPBUGS-100332, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.

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.

Details

In response to this:

/jira refresh

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.

@vsolanki12

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown

@vsolanki12: This pull request references Jira Issue OCPBUGS-100332, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.

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.

Details

In response to this:

/jira refresh

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.

@vsolanki12

Copy link
Copy Markdown
Contributor Author

/jira refresh

@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

@vsolanki12: This pull request references Jira Issue OCPBUGS-100332, which is valid.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note text is set and does not match the template
  • dependent bug Jira Issue OCPBUGS-86843 is in the state Verified, which is one of the valid states (MODIFIED, ON_QA, VERIFIED)
  • dependent Jira Issue OCPBUGS-86843 targets the "5.0.0" version, which is one of the valid target versions: 5.0.0
  • bug has dependents
Details

In response to this:

/jira refresh

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.

@bryan-cox bryan-cox left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/approve

@openshift-ci

openshift-ci Bot commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: bryan-cox, vsolanki12

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 31, 2026
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. area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release 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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants