Skip to content

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

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

coderabbitai Bot commented Aug 7, 2026

Copy link
Copy Markdown
📝 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
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.
Title check ✅ Passed The title clearly identifies the proxy hook and its HyperShift CSI driver deployment scope.
Description check ✅ Passed The description directly explains the proxy hook, affected deployments, registration, problem, fix, and test coverage.
✨ 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

@jsafrane

Copy link
Copy Markdown
Contributor

/lgtm
/approve

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

Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-upgrade
/test e2e-azure
/test e2e-azure-csi
/test e2e-azure-file-csi
/test e2e-azure-file-nfs-csi
/test e2e-azure-ovn-upgrade
/test e2e-gcp
/test e2e-gcp-csi
/test e2e-gcp-ovn-upgrade

@openshift-ci

openshift-ci Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jsafrane, PoornimaSingour

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 10, 2026
@jsafrane jsafrane changed the title fix(OCPBUGS-105392): Add proxy hook for HyperShift CSI driver controller deployments OCPBUGS-105392: Add proxy hook for HyperShift CSI driver controller deployments Aug 10, 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 10, 2026
@openshift-ci-robot

Copy link
Copy Markdown

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

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

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.

@PoornimaSingour

Copy link
Copy Markdown
Author

/test hypershift-e2e-aks

@PoornimaSingour

Copy link
Copy Markdown
Author

End-to-End Fix Validation Summary

Bug : aws-ebs-csi-driver-controller deployment missing proxy environment variables (HTTP_PROXY, HTTPS_PROXY, NO_PROXY) on proxy-required management clusters, causing PVC provisioning failures due to STS timeout when reaching AWS APIs.

Fix — 3 PRs across 3 repos

PR 1: openshift/hypershift#9256 (CPO)

  • CPO reads management cluster proxy env vars from os.Getenv() and sets them on the CSO deployment it creates in the HCP
    namespace.

PR 2: openshift/cluster-storage-operator#723 (CSO)

  • CSO passes its own proxy env vars down to the aws-ebs-csi-driver-operator deployment it manages.

PR 3: #594 (csi-operator)

  • aws-ebs-csi-driver-operator adds a withHyperShiftProxy hook that injects proxy env vars into all containers of the
    aws-ebs-csi-driver-controller deployment when running in HyperShift flavour.

Test Environment

  • Management cluster: proxy-mgmt.india.aws.cee.support (OCP 5.0.0-ec.4)
  • Squid proxy: EC2 instance at 100.55.73.101:3128 — all management cluster traffic goes through it
  • HostedCluster: proxy-test-full in namespace local-cluster
  • HCP namespace: local-cluster-proxy-test-full
  • AWS region: us-east-1
  • OIDC S3 bucket: psingour-hcp-oidc

Custom Images Built and Deployed

  • CPO/HO: quay.io/rhn_support_psingour/hypershift:proxy-fix-858768f177 (built from Dockerfile.dev with
    --platform=linux/amd64)
  • CSO: quay.io/rhn_support_psingour/cluster-storage-operator:proxy-fix (built from CSO repo Dockerfile)
  • csi-operator: quay.io/rhn_support_psingour/aws-ebs-csi-driver-operator:proxy-fix (built from Dockerfile.aws-ebs)
  • Custom release image: quay.io/rhn_support_psingour/hypershift:ocp-release-proxy-fix (built with oc adm release new on a
    management cluster node, swapping in custom CSO and csi-operator images)

How Custom Images Were Applied

  • HO: bin/hypershift install --hypershift-image quay.io/rhn_support_psingour/hypershift:proxy-fix-858768f177
  • CPO: Annotation hypershift.openshift.io/control-plane-operator-image on the HostedCluster
  • CSO + csi-operator: Baked into the custom release image used in hypershift create cluster aws --release-image

Proxy Chain Validation

Step 1: CPO sets proxy on CSO

  $ oc get deployment cluster-storage-operator -n local-cluster-proxy-test-full -o json | grep -A1 PROXY
  
  Container: cluster-storage-operator
    HTTP_PROXY=http://100.55.73.101:3128
    HTTPS_PROXY=http://100.55.73.101:3128
    NO_PROXY=.cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14,127.0.0.1,169.254.169.254,172.30.0.0/16,api-int.prox
  y-mgmt.india.aws.cee.support,kube-apiserver,localhost

Step 2: CSO sets proxy on aws-ebs-csi-driver-operator

$ oc get deployment aws-ebs-csi-driver-operator -n local-cluster-proxy-test-full -o json | grep -A1 PROXY
 
 Container: aws-ebs-csi-driver-operator
   HTTP_PROXY=http://100.55.73.101:3128
   HTTPS_PROXY=http://100.55.73.101:3128
   NO_PROXY=.cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14,127.0.0.1,169.254.169.254,172.30.0.0/16,api-int.prox
 y-mgmt.india.aws.cee.support,kube-apiserver,localhost
 
 Container: token-minter
   HTTP_PROXY=http://100.55.73.101:3128
   HTTPS_PROXY=http://100.55.73.101:3128
   NO_PROXY=.cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14,127.0.0.1,169.254.169.254,172.30.0.0/16,api-int.prox
 y-mgmt.india.aws.cee.support,kube-apiserver,localhost

Step 3: aws-ebs-csi-driver-operator sets proxy on aws-ebs-csi-driver-controller (all 12 containers)


  $ oc get deployment aws-ebs-csi-driver-controller -n local-cluster-proxy-test-full -o json | grep -A1 PROXY

  Container: csi-driver
    HTTP_PROXY=http://100.55.73.101:3128
    HTTPS_PROXY=http://100.55.73.101:3128
    
  Container: csi-provisioner
    HTTP_PROXY=http://100.55.73.101:3128
    HTTPS_PROXY=http://100.55.73.101:3128
    NO_PROXY=.cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14,...
    
  Container: csi-attacher
    HTTP_PROXY=http://100.55.73.101:3128
    HTTPS_PROXY=http://100.55.73.101:3128
    NO_PROXY=.cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14,...
    
  Container: csi-resizer
    HTTP_PROXY=http://100.55.73.101:3128
    HTTPS_PROXY=http://100.55.73.101:3128
    NO_PROXY=.cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14,...
    
  Container: csi-snapshotter
    HTTP_PROXY=http://100.55.73.101:3128
    HTTPS_PROXY=http://100.55.73.101:3128
    NO_PROXY=.cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14,...
    
  Container: csi-liveness-probe
    HTTP_PROXY=http://100.55.73.101:3128
    HTTPS_PROXY=http://100.55.73.101:3128
    NO_PROXY=.cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14,...
    
  Container: token-minter
    HTTP_PROXY=http://100.55.73.101:3128
    HTTPS_PROXY=http://100.55.73.101:3128
    NO_PROXY=.cluster.local,.ec2.internal,.svc,10.0.0.0/16,10.128.0.0/14,...
    
  (+ 5 kube-rbac-proxy sidecar containers, all with same proxy vars)

PVC Provisioning Test (end-to-end proof)

Guest cluster nodes

$ oc --kubeconfig=/tmp/guest-kubeconfig.yaml get nodes
 NAME                          STATUS   ROLES    AGE   VERSION
 ip-10-0-128-46.ec2.internal   Ready    worker   10m   v1.35.3
 ip-10-0-133-12.ec2.internal   Ready    worker   10m   v1.35.3

PVC status — Bound

  $ oc --kubeconfig=/tmp/guest-kubeconfig.yaml get pvc -n default
  NAME             STATUS   VOLUME                                     CAPACITY   ACCESS MODES   STORAGECLASS   AGE
  proxy-test-pvc   Bound    pvc-c3bd0113-9f67-4a2b-be7d-07a3b323c869   1Gi        RWO            gp3-csi        48m

PV details — gp3 EBS volume provisioned

$ oc --kubeconfig=/tmp/guest-kubeconfig.yaml get pv
NAME                                       CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS   CLAIM
STORAGECLASS   AGE                         
pvc-c3bd0113-9f67-4a2b-be7d-07a3b323c869   1Gi        RWO            Delete           Bound    default/proxy-test-pvc
gp3-csi        8m56s

Pod status — Running

  $ oc --kubeconfig=/tmp/guest-kubeconfig.yaml get pod proxy-test-pod -n default
  NAME             READY   STATUS    RESTARTS   AGE
  proxy-test-pod   1/1     Running   0          48m

This proves the aws-ebs-csi-driver-controller can now reach AWS STS through the proxy to assume the IAM role and call EC2 CreateVolume successfully.

@PoornimaSingour

Copy link
Copy Markdown
Author

/retest

@PoornimaSingour

Copy link
Copy Markdown
Author

/retest hypershift-e2e-aks

@PoornimaSingour

Copy link
Copy Markdown
Author

/retest

@openshift-ci

openshift-ci Bot commented Aug 12, 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

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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants