Skip to content

OCPBUGS-98643: Add readiness probes to konnectivity proxy sidecars#9051

Open
hypershift-jira-solve-ci[bot] wants to merge 2 commits into
openshift:mainfrom
hypershift-community:fix-OCPBUGS-98643
Open

OCPBUGS-98643: Add readiness probes to konnectivity proxy sidecars#9051
hypershift-jira-solve-ci[bot] wants to merge 2 commits into
openshift:mainfrom
hypershift-community:fix-OCPBUGS-98643

Conversation

@hypershift-jira-solve-ci

@hypershift-jira-solve-ci hypershift-jira-solve-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

Adds TCP socket readiness probes to the konnectivity proxy sidecar containers. Without readiness probes, Kubernetes considers these containers ready immediately upon start, causing the parent pod to report Ready before the HTTP/SOCKS5 listener is actually accepting connections. This leads to HostedCluster Available=True being set prematurely while proxy-dependent components cannot yet reach the guest cluster network.

The fix adds TCP socket readiness probes on the serving port so pods are not marked Ready until the proxy listener is operational. It also consolidates the serving port logic by reusing servingPort() for --serving-port CLI argument construction, eliminating duplication with the readiness probe port resolution, and improves test coverage with dual-mode readiness probe assertions.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/OCPBUGS-98643

Special notes for your reviewer:

  • servingPort() now has an explicit default case for consistency.
  • The magic number 8090 in tests has been replaced with the defaultKonnectivityServingPort constant.
  • Tests cover both the default port and the OAuth-like custom port scenario.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Always review AI generated responses prior to use.
Generated with Claude Code via openshift-developer plugin


Note: This PR was auto-generated by the jira-agent periodic CI job in response to OCPBUGS-98643. See the full report for token usage, cost breakdown, and detailed phase output.

Summary by CodeRabbit

  • Bug Fixes
    • Added readiness checks for Konnectivity proxy containers.
    • Readiness probes now verify connectivity on the configured serving port.
    • Ensured HTTPS and Socks5 modes consistently use custom or default serving ports.

OpenShift CI Bot and others added 2 commits July 22, 2026 09:09
Without readiness probes, Kubernetes considers the konnectivity proxy
sidecar containers ready immediately upon start. This causes the parent
pod to report Ready before the HTTP/SOCKS5 listener is accepting
connections, leading to HostedCluster Available=True being set
prematurely while proxy-dependent components cannot reach the guest
cluster network.

Add TCP socket readiness probes on the serving port so pods are not
marked Ready until the proxy listener is operational.

Signed-off-by: OpenShift CI Bot <ci-bot@redhat.com>
Use servingPort() for --serving-port CLI arg construction to eliminate
duplication with readiness probe port resolution. Add explicit default
case to servingPort() for consistency. Replace magic number 8090 with
defaultKonnectivityServingPort constant in tests. Add Dual-mode
readiness probe assertions covering the OAuth-like custom port scenario.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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-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 22, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@hypershift-jira-solve-ci[bot]: This pull request references Jira Issue OCPBUGS-98643, which is invalid:

  • expected the bug to target the "5.0.0" version, but no target version was set

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:

What this PR does / why we need it:

Adds TCP socket readiness probes to the konnectivity proxy sidecar containers. Without readiness probes, Kubernetes considers these containers ready immediately upon start, causing the parent pod to report Ready before the HTTP/SOCKS5 listener is actually accepting connections. This leads to HostedCluster Available=True being set prematurely while proxy-dependent components cannot yet reach the guest cluster network.

The fix adds TCP socket readiness probes on the serving port so pods are not marked Ready until the proxy listener is operational. It also consolidates the serving port logic by reusing servingPort() for --serving-port CLI argument construction, eliminating duplication with the readiness probe port resolution, and improves test coverage with dual-mode readiness probe assertions.

Which issue(s) this PR fixes:

Fixes https://redhat.atlassian.net/browse/OCPBUGS-98643

Special notes for your reviewer:

  • servingPort() now has an explicit default case for consistency.
  • The magic number 8090 in tests has been replaced with the defaultKonnectivityServingPort constant.
  • Tests cover both the default port and the OAuth-like custom port scenario.

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Always review AI generated responses prior to use.
Generated with Claude Code via openshift-developer plugin

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 22, 2026

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

Konnectivity container construction now resolves a configured HTTPS or Socks5 serving port, falling back to port 8090. The resolved port is used for the proxy argument and a TCP readiness probe with five-second initial delay and period. Tests cover default and custom ports for single-mode and dual-mode container configurations.

Sequence Diagram(s)

sequenceDiagram
  participant buildContainer
  participant servingPort
  participant KonnectivityContainer
  buildContainer->>servingPort: resolve configured or default port
  servingPort-->>buildContainer: return serving port
  buildContainer->>KonnectivityContainer: configure serving argument and TCP readiness probe
Loading

Suggested reviewers: bryan-cox

🚥 Pre-merge checks | ✅ 11
✅ Passed checks (11 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding readiness probes to konnectivity proxy sidecars.
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 added/updated test names are static string literals in t.Run; no generated values, timestamps, IPs, or interpolation appear.
Test Structure And Quality ✅ Passed These are isolated table-driven unit tests with no cluster resources or waits; setup uses t.Setenv and the assertions are focused and consistent with repo patterns.
Topology-Aware Scheduling Compatibility ✅ Passed No topology-sensitive scheduling was added: the PR only changes konnectivity container ports/readiness probes, with no affinity, nodeSelector, spread, taint, or replica logic.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PASS: The PR only adds standard Go unit tests in support/controlplane-component; no Ginkgo e2e constructs or external-network assumptions were added.
No-Weak-Crypto ✅ Passed Touched files only add readiness probes and serving-port logic; scans found no weak crypto, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed No privileged flags or insecure pod settings were added; the change only adjusts serving-port logic and adds a TCP readiness probe.
No-Sensitive-Data-In-Logs ✅ Passed No logging statements were added or changed in the touched files; the new code only builds args and probes, and tests use fake values.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@openshift-ci
openshift-ci Bot requested review from devguyio and muraee July 22, 2026 09:41
@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 labels Jul 22, 2026
@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: hypershift-jira-solve-ci[bot]
Once this PR has been reviewed and has the lgtm label, please assign jparrill for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

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

🧹 Nitpick comments (1)
support/controlplane-component/konnectivity-container.go (1)

200-201: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Name the readiness-probe timing contract.

  • support/controlplane-component/konnectivity-container.go#L200-L201: replace 5 literals with named timing constants.
  • support/controlplane-component/konnectivity-container_test.go#L197-L198: use named test expectation constants so the asserted values remain explicit.

As per coding guidelines, “Avoid magic numbers — use named constants.”

🤖 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 `@support/controlplane-component/konnectivity-container.go` around lines 200 -
201, Replace the readiness probe’s literal InitialDelaySeconds and PeriodSeconds
values in support/controlplane-component/konnectivity-container.go:200-201 with
named timing constants. Update the corresponding expectations in
support/controlplane-component/konnectivity-container_test.go:197-198 to use
named test constants, keeping the asserted values explicit and consistent.

Source: Coding guidelines

🤖 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 `@support/controlplane-component/konnectivity-container.go`:
- Around line 200-201: Replace the readiness probe’s literal InitialDelaySeconds
and PeriodSeconds values in
support/controlplane-component/konnectivity-container.go:200-201 with named
timing constants. Update the corresponding expectations in
support/controlplane-component/konnectivity-container_test.go:197-198 to use
named test constants, keeping the asserted values explicit and consistent.

ℹ️ Review info
⚙️ Run configuration

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

Review profile: CHILL

Plan: Enterprise

Run ID: ee64cc1e-a923-4fa3-9fe8-06e5ceff0bc9

📥 Commits

Reviewing files that changed from the base of the PR and between 97db458 and f337b99.

📒 Files selected for processing (2)
  • support/controlplane-component/konnectivity-container.go
  • support/controlplane-component/konnectivity-container_test.go

@openshift-ci

openshift-ci Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

@hypershift-jira-solve-ci[bot]: 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.

@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 91.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 44.46%. Comparing base (97db458) to head (f337b99).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
...t/controlplane-component/konnectivity-container.go 91.66% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9051      +/-   ##
==========================================
+ Coverage   44.44%   44.46%   +0.01%     
==========================================
  Files         774      774              
  Lines       96977    96995      +18     
==========================================
+ Hits        43105    43127      +22     
+ Misses      50897    50895       -2     
+ Partials     2975     2973       -2     
Files with missing lines Coverage Δ
...t/controlplane-component/konnectivity-container.go 42.13% <91.66%> (+8.05%) ⬆️
Flag Coverage Δ
cmd-support 38.44% <91.66%> (+0.04%) ⬆️
cpo-other 45.25% <ø> (ø)
hypershift-operator 54.22% <ø> (ø)
other 32.64% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@muraee

muraee commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

You need to regenerate fixtures with UPDATE=true go test ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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/invalid-bug Indicates that a referenced Jira bug is invalid 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.

2 participants