Skip to content

fix(OCPBUGS-105392): Add proxy hook for HyperShift CSI driver controller deployments - #594

Open
PoornimaSingour wants to merge 2 commits into
openshift:mainfrom
PoornimaSingour:OCPBUGS-105392/hypershift-proxy-hook
Open

fix(OCPBUGS-105392): Add proxy hook for HyperShift CSI driver controller deployments#594
PoornimaSingour wants to merge 2 commits into
openshift:mainfrom
PoornimaSingour:OCPBUGS-105392/hypershift-proxy-hook

Conversation

@PoornimaSingour

Copy link
Copy Markdown

Summary

  • Add withHyperShiftProxy hook to inject management cluster proxy env vars (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) into CSI driver controller containers in HyperShift mode.
  • Register the hook in NewDefaultOperatorControllerConfig for the HyperShift branch
  • Add unit tests covering full proxy, partial proxy, and no-proxy scenarios

Problem

In NewDefaultOperatorControllerConfig(), the standalone branch registers withClusterWideProxy which reads proxy from the guest cluster's observedConfig. The HyperShift branch has no proxy hook at all, leaving CSI driver controller containers (csi-driver, csi-provisioner, csi-attacher, etc.) unable to reach cloud APIs when the management cluster requires a proxy.

Fix

The new withHyperShiftProxy hook reads proxy env vars from os.Getenv() (management cluster proxy) and injects them into all containers. This follows the same pattern as withHyperShiftControlPlaneImages and withHyperShiftRunAsUser in the same file. It is a no-op when no proxy is configured. Standalone mode is unaffected.

This is step 3 of a 3-repo fix:

  1. HyperShift CPO (OCPBUGS-105282) — Inject proxy env vars into CSO deployment
  2. cluster-storage-operator (OCPBUGS-105391) — Pass proxy env vars to operand deployments
  3. csi-operator (this PR) — Add withHyperShiftProxy hook to inject proxy into CSI driver controller containers

Test plan

  • Unit tests pass: go test -race ./pkg/driver/common/operator/... -v
  • make test passes
  • make verify passes
  • Full end-to-end validation requires all 3 repos fixed and tested on a proxy-required management cluster

JIRA

…ler deployments

  The HyperShift mode was missing a proxy hook in NewDefaultOperatorControllerConfig,
  leaving CSI driver controller containers without HTTP_PROXY, HTTPS_PROXY, and
  NO_PROXY when the management cluster requires a proxy for external access.
@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 a review from jsafrane August 7, 2026 13:56
@openshift-ci

openshift-ci Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: PoornimaSingour
Once this PR has been reviewed and has the lgtm label, please assign romanbednar 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 commented Aug 7, 2026

Copy link
Copy Markdown

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: Pro Plus

Run ID: 8ee15404-293b-4345-9931-5ebaa7398dae

📥 Commits

Reviewing files that changed from the base of the PR and between 67ecf2c and ea4cf8c.

📒 Files selected for processing (1)
  • pkg/driver/common/operator/hooks_test.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/driver/common/operator/hooks_test.go

📝 Walkthrough

Walkthrough

The HyperShift deployment hook list now includes withHyperShiftProxy. The hook reads non-empty HTTP_PROXY, HTTPS_PROXY, and NO_PROXY values and appends them to every deployment container. Tests cover complete, partial, and absent proxy configurations.

Suggested reviewers: jsafrane, tsmetana

🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description check ✅ Passed The description clearly explains the proxy hook, its registration, affected deployments, tests, and unchanged standalone behavior.
Title check ✅ Passed The title clearly identifies the proxy hook added for HyperShift CSI driver controller deployments and includes the relevant issue identifier.
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 No Ginkgo tests exist; all relevant t.Run cases use static literal names such as “only HTTP_PROXY is set” and contain no generated values or runtime interpolation.
Test Structure And Quality ✅ Passed The tests use focused table-driven t.Run cases, t.Setenv cleanup, fake clients, and contextual assertion messages; they perform no cluster waits or resource creation requiring timeouts.
Microshift Test Compatibility ✅ Passed The PR adds Go unit tests using testing.T, not Ginkgo e2e tests; no It, Describe, Context, or When tests were added, so MicroShift API checks do not apply.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The PR adds standard Go unit tests, not Ginkgo e2e tests; they use fake clients and do not assume multiple nodes or HA scheduling.
Topology-Aware Scheduling Compatibility ✅ Passed The PR only registers a hook that appends proxy environment variables; it adds no affinity, topology spread, node selector, toleration, PDB, replica, or rollout scheduling constraint.
Ote Binary Stdout Contract ✅ Passed The PR adds only proxy environment mutation and t.Setenv-based tests; no main/init/suite stdout writes, fmt.Print, log output, or OTE suite setup was added.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Not applicable: the added test is standard Go Test_WithHyperShiftProxy, not a Ginkgo e2e test. It only checks environment variables and performs no network or external access.
No-Weak-Crypto ✅ Passed The PR diff only adds proxy environment handling and tests; it introduces no MD5, SHA1, DES, RC4, 3DES, Blowfish, ECB, custom crypto, or secret comparisons.
Container-Privileges ✅ Passed The PR changes only Go hook code and tests; the diff adds no privileged, hostPID, hostNetwork, hostIPC, SYS_ADMIN, root, or allowPrivilegeEscalation settings.
No-Sensitive-Data-In-Logs ✅ Passed The PR adds no production logging. Proxy values are only copied into container EnvVar fields, and tests use sanitized example.com values; no passwords, tokens, hostnames, or customer data are logged.
✨ 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 requested a review from tsmetana August 7, 2026 13:56

@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/driver/common/operator/hooks.go`:
- Line 46: Update the flavour branching around AddDeploymentHookBuilders so the
HyperShift-only builders are registered exclusively when ClusterFlavour equals
generator.FlavourHyperShift. Keep generator.FlavourStandalone on the regular
path and handle any unsupported flavour explicitly instead of routing it through
the HyperShift branch.
🪄 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: Pro Plus

Run ID: 99f83c41-99a4-4326-8cd2-349cd7e081be

📥 Commits

Reviewing files that changed from the base of the PR and between 756f6b8 and 67ecf2c.

📒 Files selected for processing (2)
  • pkg/driver/common/operator/hooks.go
  • pkg/driver/common/operator/hooks_test.go

Comment thread pkg/driver/common/operator/hooks.go
@PoornimaSingour

Copy link
Copy Markdown
Author

/retest

@openshift-ci

openshift-ci Bot commented Aug 8, 2026

Copy link
Copy Markdown
Contributor

@PoornimaSingour: The following test 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/hypershift-e2e-aks ea4cf8c link false /test hypershift-e2e-aks

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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant