Skip to content

OCPBUGS-99288: Add proxy env vars to AWS cloud-controller-manager deployment - #9053

Merged
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
PoornimaSingour:OCPBUGS-99288-ccm-proxy-env-vars
Jul 29, 2026
Merged

OCPBUGS-99288: Add proxy env vars to AWS cloud-controller-manager deployment#9053
openshift-merge-bot[bot] merged 2 commits into
openshift:mainfrom
PoornimaSingour:OCPBUGS-99288-ccm-proxy-env-vars

Conversation

@PoornimaSingour

@PoornimaSingour PoornimaSingour commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:

The AWS Cloud Controller Manager (CCM) deployment was missing HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables when the management cluster is configured with a proxy. This was a regression from the v1 to v2 component framework migration where the proxy.SetEnvVars() call was not carried over.

This PR adds an adaptDeployment function that calls proxy.SetEnvVars() on the CCM container, following the same pattern used by other components (cloud-credential-operator, konnectivity, etc.).

Which issue(s) this PR fixes:

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

Special notes for your reviewer:

  • proxy.SetEnvVars() reads from os.Getenv("HTTP_PROXY") etc., which are inherited from the management cluster's proxy configuration. When no proxy is configured, the function is a no-op.
  • Verified on a live cluster (5.0.0-ec.4) that proxy env vars are correctly injected into the CCM container when the CPO process has proxy env vars set.
  • All 22 guest cluster operators were healthy after the change.

Checklist:

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

Summary by CodeRabbit

  • New Features
    • Added proxy environment variable support to the AWS cloud-controller-manager deployment, automatically configuring HTTP, HTTPS, and no-proxy behavior based on provided values.
  • Bug Fixes
    • Ensured cloud-controller-manager is updated with the correct proxy environment variables (including expected AWS-related proxy configuration behavior).
  • Tests
    • Added unit coverage validating proxy environment variables are applied or omitted correctly across multiple proxy scenarios.

@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

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

The CCM deployment was missing HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables when the management cluster is configured with a proxy. This was a regression from the v1 to v2 component framework migration where the proxy.SetEnvVars() call was not carried over.

What this PR does / why we need it:

Which issue(s) this PR fixes:

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

Special notes for your reviewer:

Checklist:

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

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

The AWS cloud-controller-manager component now registers a deployment adapter. The adapter targets the cloud-controller-manager container and injects proxy environment variables using proxy.SetEnvVars. Tests cover HTTP, HTTPS, NO_PROXY, and no-proxy configurations.

Suggested reviewers: clebs, sdminonne, muraee

🚥 Pre-merge checks | ✅ 10 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Test Structure And Quality ⚠️ Warning The new test mixes proxy injection checks with AWS env-var preservation in one subcase and most Expectations are bare, so diagnostics and single-responsibility are weak. Split AWS-env preservation into its own test/subtest, add meaningful messages to key Expectations, and keep each case focused on one behavior.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: adding proxy environment variables to the AWS cloud-controller-manager deployment.
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 The added test names are static t.Run strings; I found no fmt.Sprintf, random values, timestamps, or other dynamic title construction in the touched test file.
Topology-Aware Scheduling Compatibility ✅ Passed The PR only adds proxy env injection to the CCM container; it introduces no replicas, nodeSelectors, anti-affinity, or spread constraints.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Only a unit test was added; no Ginkgo e2e test, IPv4-only networking, or external connectivity is present in the changed files.
No-Weak-Crypto ✅ Passed The new code only injects proxy env vars; no weak algorithms, custom crypto, or secret/token comparisons appear in the touched files or package.
Container-Privileges ✅ Passed AWS CCM manifest and new adaptDeployment only add proxy env vars; no privileged, hostPID/Network/IPC, SYS_ADMIN, or allowPrivilegeEscalation settings found.
No-Sensitive-Data-In-Logs ✅ Passed No logging was added in the changed files; the PR only wires proxy env vars into the CCM container and adds tests.
✨ 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 added area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform and removed do-not-merge/needs-area labels Jul 22, 2026
@PoornimaSingour
PoornimaSingour marked this pull request as draft July 22, 2026 11:23
@openshift-ci
openshift-ci Bot requested review from jparrill and sdminonne July 22, 2026 11:23
@openshift-ci openshift-ci Bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 22, 2026
@PoornimaSingour
PoornimaSingour force-pushed the OCPBUGS-99288-ccm-proxy-env-vars branch from 89370dd to 747e029 Compare July 22, 2026 11:34
@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 22, 2026
@openshift-ci-robot

Copy link
Copy Markdown

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

In response to this:

The CCM deployment was missing HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables when the management cluster is configured with a proxy. This was a regression from the v1 to v2 component framework migration where the proxy.SetEnvVars() call was not carried over.

What this PR does / why we need it:

Which issue(s) this PR fixes:

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

Special notes for your reviewer:

Checklist:

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

Summary by CodeRabbit

  • New Features

  • Added proxy environment variable support to the AWS cloud-controller-manager deployment.

  • Automatically configures HTTP, HTTPS, and no-proxy settings when provided.

  • Bug Fixes

  • Ensured local and Kubernetes API addresses remain excluded from proxy routing.

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-robot

Copy link
Copy Markdown

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

In response to this:

The CCM deployment was missing HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables when the management cluster is configured with a proxy. This was a regression from the v1 to v2 component framework migration where the proxy.SetEnvVars() call was not carried over.

What this PR does / why we need it:

Which issue(s) this PR fixes:

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

Special notes for your reviewer:

Checklist:

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

Summary by CodeRabbit

  • New Features

  • Added proxy environment variable support to the AWS cloud-controller-manager deployment.

  • Automatically configures HTTP, HTTPS, and no-proxy settings when provided.

  • Bug Fixes

  • Ensured local and Kubernetes API addresses remain excluded from proxy routing.

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
Contributor Author

OCPBUGS-99288 — Complete Summary

Problem

AWS Cloud Controller Manager (CCM) deployment was missing HTTP_PROXY/HTTPS_PROXY/NO_PROXY environment variables when the management cluster uses a proxy. Other components (CCO, CAPA, konnectivity) already had this — CCM was the gap.

Fix:

  1. component.go — Added .WithAdaptFunction(adaptDeployment) to the AWS CCM component builder chain
  2. deployment.go (new file) — adaptDeployment() calls proxy.SetEnvVars() on the cloud-controller-manager container, which reads proxy config from the CPO process environment and injects it into the container's env vars

Verified on Cluster:
Hosted Cluster

  • Name: proxy-test
  • Namespace: clusters
  • HCP Namespace: clusters-proxy-test
  • Branch: OCPBUGS-99288-ccm-proxy-env-vars
  • CPO image: quay.io/rhn_support_psingour/hypershift:OCPBUGS-99288-v3
  • Release image: 5.0.0-ec.4 (quay.io/openshift-release-dev/ocp-release@sha256:a6ba8...)
    Fix (2 files changed)

Testing Done

  • Unit test (deployment_test.go) — Proxy vars injected when set, not injected when absent. PASS.
  • On-cluster: CCM healthy — adaptDeployment wired in correctly, CCM runs 2/2 with no crashes. PASS.
  • On-cluster: Full cluster healthy — All 22 guest cluster operators Available, 2/2 nodes Ready, cluster Completed. PASS.
  • On-cluster: Proxy vars verified — Patched CPO with fake proxy env vars, CCM container got HTTP_PROXY, HTTPS_PROXY, NO_PROXY injected. PASS.

@PoornimaSingour
PoornimaSingour marked this pull request as ready for review July 23, 2026 08:38
@openshift-ci openshift-ci Bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 23, 2026
@codecov

codecov Bot commented Jul 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 44.51%. Comparing base (b5f3906) to head (4afcef2).
⚠️ Report is 53 commits behind head on main.

Files with missing lines Patch % Lines
...plane/v2/cloud_controller_manager/aws/component.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #9053      +/-   ##
==========================================
+ Coverage   44.50%   44.51%   +0.01%     
==========================================
  Files         774      775       +1     
  Lines       96980    97003      +23     
==========================================
+ Hits        43164    43184      +20     
- Misses      50828    50831       +3     
  Partials     2988     2988              
Files with missing lines Coverage Δ
...lane/v2/cloud_controller_manager/aws/deployment.go 100.00% <100.00%> (ø)
...plane/v2/cloud_controller_manager/aws/component.go 0.00% <0.00%> (ø)

... and 2 files with indirect coverage changes

Flag Coverage Δ
cmd-support 38.39% <ø> (ø)
cpo-hostedcontrolplane 47.23% <83.33%> (+0.04%) ⬆️
cpo-other 45.25% <ø> (ø)
hypershift-operator 54.45% <ø> (+<0.01%) ⬆️
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.

@openshift-ci
openshift-ci Bot requested review from clebs and muraee July 23, 2026 08:38
…r deployment

  The CCM deployment was missing HTTP_PROXY, HTTPS_PROXY, and NO_PROXY
  environment variables when the management cluster is configured with a
  proxy. This was a regression from the v1 to v2 component framework
  migration where the proxy.SetEnvVars() call was not carried over.
@PoornimaSingour
PoornimaSingour force-pushed the OCPBUGS-99288-ccm-proxy-env-vars branch from 747e029 to ec5ae7a Compare July 23, 2026 08:54

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

Dropped a comment, please let me know for tagging. Thanks

httpsProxy string
noProxy string
validate func(*WithT, *corev1.Container)
}{

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.

The two test cases cover the main paths well. A couple of optional suggestions if you want to strengthen coverage:

  1. Partial proxy: What happens when only HTTP_PROXY is set but HTTPS_PROXY is empty? proxy.SetEnvVars has a branch for this (if httpProxy != "" || httpsProxy != "").

  2. Existing env vars preserved: The CCM manifest already defines AWS_SHARED_CREDENTIALS_FILE, AWS_SDK_LOAD_CONFIG, and AWS_EC2_METADATA_DISABLED. Might be worth asserting those survive after adaptDeployment runs — the CCO tests do something similar.

Neither is blocking, the current coverage is reasonable for a bug fix.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you @jparrill , Added Partials Proxy case as well and also added assertions for AWS_SHARED_CREDENTIALS_FILE, AWS_SDK_LOAD_CONFIG, and AWS_EC2_METADATA_DISABLED in the full-proxy test case to verify they're preserved after proxy injection.

…cases

Add test coverage for partial proxy configurations (HTTP_PROXY-only and
HTTPS_PROXY-only) and assert that existing AWS env vars are preserved
after proxy injection, addressing review feedback.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

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

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
`@control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment_test.go`:
- Around line 51-83: Update the proxy test cases using the noProxy fixture to
include a distinct user-supplied entry such as api.internal.example.com, and
extend their validate callbacks to assert that entry remains in the generated
NO_PROXY value alongside localhost, 127.0.0.1, and kube-apiserver. Ensure the
assertions cover preservation of custom bypass entries, not only adapter-added
defaults.
🪄 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: c5376068-fb8a-496a-92c3-ca9d1efef780

📥 Commits

Reviewing files that changed from the base of the PR and between ec5ae7a and 4afcef2.

📒 Files selected for processing (1)
  • control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment_test.go

@muraee

muraee commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

/approve

@openshift-ci

openshift-ci Bot commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: muraee, 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 Jul 24, 2026
@jparrill

Copy link
Copy Markdown
Contributor

/lgtm

@jparrill

Copy link
Copy Markdown
Contributor

/label acknowledge-critical-fixes-only

@openshift-ci openshift-ci Bot added the acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. label Jul 27, 2026
@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jul 27, 2026
@openshift-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-azure-v2-self-managed
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws
/test e2e-v2-gke
/test unit
/test verify

@PoornimaSingour

Copy link
Copy Markdown
Contributor Author

/retest

@PoornimaSingour

Copy link
Copy Markdown
Contributor Author

/test e2e-v2-gke

@vsolanki12

Copy link
Copy Markdown
Contributor

/verified by @vsolanki12

Verification Report PR #9053

Environment

  • Management cluster: OCP 4.22.6, AWS IPI dual-stack, ap-south-1
  • Hosted cluster: pr9053, OCP 5.0.0-ec.4, 2 worker nodes
  • CPO image: quay.io/rhn_support_psingour/hypershift:OCPBUGS-99288-verified

Verification Report for PR #9053

Environment

  • Management cluster: OCP 4.22.6, AWS IPI dual-stack, ap-south-1
  • Hosted cluster: pr9053, OCP 5.0.0-ec.4, 2 worker nodes
  • CPO image: quay.io/rhn_support_psingour/hypershift:OCPBUGS-99288-verified

1. Unit Tests PASS (8/8)

  $ go test -v ./control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/...
   === RUN   TestConfig
  --- PASS: TestConfig (0.00s)
  === RUN   TestConfigErrorStates
  === RUN   TestConfigErrorStates/invalid_load_balancer_health_probe_mode
  --- PASS: TestConfigErrorStates (0.00s)
      --- PASS: TestConfigErrorStates/invalid_load_balancer_health_probe_mode (0.00s)
  === RUN   TestAdaptDeployment
  === RUN   TestAdaptDeployment/When_proxy_environment_variables_are_set,_it_should_add_proxy_env_vars_to_container
  === RUN   TestAdaptDeployment/When_only_HTTP_PROXY_is_set,_it_should_add_HTTP_PROXY_and_NO_PROXY_but_not_HTTPS_PROXY
  === RUN   TestAdaptDeployment/When_only_HTTPS_PROXY_is_set,_it_should_add_HTTPS_PROXY_and_NO_PROXY_but_not_HTTP_PROXY
  === RUN   TestAdaptDeployment/When_no_proxy_is_set,_it_should_not_add_proxy_env_vars
  --- PASS: TestAdaptDeployment (0.00s)
      --- PASS: TestAdaptDeployment/When_proxy_environment_variables_are_set,_it_should_add_proxy_env_vars_to_container (0.00s)
      --- PASS: TestAdaptDeployment/When_only_HTTP_PROXY_is_set,_it_should_add_HTTP_PROXY_and_NO_PROXY_but_not_HTTPS_PROXY (0.00s)
      --- PASS: TestAdaptDeployment/When_only_HTTPS_PROXY_is_set,_it_should_add_HTTPS_PROXY_and_NO_PROXY_but_not_HTTP_PROXY (0.00s)
      --- PASS: TestAdaptDeployment/When_no_proxy_is_set,_it_should_not_add_proxy_env_vars (0.00s)
  PASS
  ok    github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws   0.654s

  8/8 tests pass — 4 TestAdaptDeployment subtests (from PR) + 2 existing TestConfig/TestConfigErrorStates.

Test cases:

  • Full proxy (HTTP_PROXY + HTTPS_PROXY + NO_PROXY) — env vars injected, AWS vars preserved
  • HTTP_PROXY only — HTTP_PROXY + NO_PROXY set, HTTPS_PROXY absent
  • HTTPS_PROXY only — HTTPS_PROXY + NO_PROXY set, HTTP_PROXY absent
  • No proxy — no proxy env vars added

2. Container Name Validation — PASS

  containerName = "cloud-controller-manager"` matches deployment manifest line 43: yaml
  name: cloud-controller-manager

3. Pattern Consistency — PASS

  proxy.SetEnvVars() is used identically in 12+ other v2 components: cloud-credential-operator, konnectivity, configoperator, kas, karpenter, ignitionserver, etc.

4. Live Cluster — Path A: No-proxy — PASS

  With no proxy configured on management cluster, CCM has only original AWS env vars:
  [
      {"name": "AWS_SHARED_CREDENTIALS_FILE", "value": "/etc/kubernetes/secrets/cloud-provider/credentials"},
      {"name": "AWS_SDK_LOAD_CONFIG", "value": "true"},
      {"name": "AWS_EC2_METADATA_DISABLED", "value": "true"}
  ]

  No HTTP_PROXY/HTTPS_PROXY/NO_PROXY — correct no-op behavior.

5. Live Cluster — Path B: Proxy Injection — PASS

  Patched CPO with proxy env vars:
  oc set env deployment/control-plane-operator -n clusters-pr9053 -c control-plane-operator \
    HTTP_PROXY=http://test-proxy.example.com:3128 \
    HTTPS_PROXY=http://test-proxy.example.com:3128 \
    NO_PROXY=localhost,127.0.0.1,.cluster.local,.svc,172.30.0.0/16,10.0.0.0/8,.amazonaws.com,quay.io,.quay.io,registry.redhat.io,.redhat.io,.redhat.com

  After CPO reconcile, CCM container has all 6 env vars:
  [
      {"name": "AWS_SHARED_CREDENTIALS_FILE", "value": "/etc/kubernetes/secrets/cloud-provider/credentials"},
      {"name": "AWS_SDK_LOAD_CONFIG", "value": "true"},
      {"name": "AWS_EC2_METADATA_DISABLED", "value": "true"},
      {"name": "HTTP_PROXY", "value": "http://test-proxy.example.com:3128"},
      {"name": "HTTPS_PROXY", "value": "http://test-proxy.example.com:3128"},
      {"name": "NO_PROXY", "value": ".amazonaws.com,.cluster.local,.quay.io,.redhat.com,.redhat.io,.svc,10.0.0.0/8,127.0.0.1,172.30.0.0/16,kube-apiserver,localhost,quay.io,registry.redhat.io"}
  ]

  kube-apiserver auto-appended to NO_PROXY by proxy.SetEnvVars() — expected behavior.

6. Guest Cluster Health — PASS

  • Nodes: 2/2 Ready
  • Cluster operators: 22/22 Available=True

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jul 28, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@vsolanki12: This PR has been marked as verified by @vsolanki12.

Details

In response to this:

/verified by @vsolanki12

Verification Report PR #9053

Environment

  • Management cluster: OCP 4.22.6, AWS IPI dual-stack, ap-south-1
  • Hosted cluster: pr9053, OCP 5.0.0-ec.4, 2 worker nodes
  • CPO image: quay.io/rhn_support_psingour/hypershift:OCPBUGS-99288-verified

Verification Report for PR #9053

Environment

  • Management cluster: OCP 4.22.6, AWS IPI dual-stack, ap-south-1
  • Hosted cluster: pr9053, OCP 5.0.0-ec.4, 2 worker nodes
  • CPO image: quay.io/rhn_support_psingour/hypershift:OCPBUGS-99288-verified

1. Unit Tests PASS (8/8)

 $ go test -v ./control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/...
  === RUN   TestConfig
 --- PASS: TestConfig (0.00s)
 === RUN   TestConfigErrorStates
 === RUN   TestConfigErrorStates/invalid_load_balancer_health_probe_mode
 --- PASS: TestConfigErrorStates (0.00s)
     --- PASS: TestConfigErrorStates/invalid_load_balancer_health_probe_mode (0.00s)
 === RUN   TestAdaptDeployment
 === RUN   TestAdaptDeployment/When_proxy_environment_variables_are_set,_it_should_add_proxy_env_vars_to_container
 === RUN   TestAdaptDeployment/When_only_HTTP_PROXY_is_set,_it_should_add_HTTP_PROXY_and_NO_PROXY_but_not_HTTPS_PROXY
 === RUN   TestAdaptDeployment/When_only_HTTPS_PROXY_is_set,_it_should_add_HTTPS_PROXY_and_NO_PROXY_but_not_HTTP_PROXY
 === RUN   TestAdaptDeployment/When_no_proxy_is_set,_it_should_not_add_proxy_env_vars
 --- PASS: TestAdaptDeployment (0.00s)
     --- PASS: TestAdaptDeployment/When_proxy_environment_variables_are_set,_it_should_add_proxy_env_vars_to_container (0.00s)
     --- PASS: TestAdaptDeployment/When_only_HTTP_PROXY_is_set,_it_should_add_HTTP_PROXY_and_NO_PROXY_but_not_HTTPS_PROXY (0.00s)
     --- PASS: TestAdaptDeployment/When_only_HTTPS_PROXY_is_set,_it_should_add_HTTPS_PROXY_and_NO_PROXY_but_not_HTTP_PROXY (0.00s)
     --- PASS: TestAdaptDeployment/When_no_proxy_is_set,_it_should_not_add_proxy_env_vars (0.00s)
 PASS
 ok    github.com/openshift/hypershift/control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws   0.654s

 8/8 tests pass — 4 TestAdaptDeployment subtests (from PR) + 2 existing TestConfig/TestConfigErrorStates.

Test cases:

  • Full proxy (HTTP_PROXY + HTTPS_PROXY + NO_PROXY) — env vars injected, AWS vars preserved
  • HTTP_PROXY only — HTTP_PROXY + NO_PROXY set, HTTPS_PROXY absent
  • HTTPS_PROXY only — HTTPS_PROXY + NO_PROXY set, HTTP_PROXY absent
  • No proxy — no proxy env vars added

2. Container Name Validation — PASS

 containerName = "cloud-controller-manager"` matches deployment manifest line 43: yaml
 name: cloud-controller-manager

3. Pattern Consistency — PASS

 proxy.SetEnvVars() is used identically in 12+ other v2 components: cloud-credential-operator, konnectivity, configoperator, kas, karpenter, ignitionserver, etc.

4. Live Cluster — Path A: No-proxy — PASS

 With no proxy configured on management cluster, CCM has only original AWS env vars:
 [
     {"name": "AWS_SHARED_CREDENTIALS_FILE", "value": "/etc/kubernetes/secrets/cloud-provider/credentials"},
     {"name": "AWS_SDK_LOAD_CONFIG", "value": "true"},
     {"name": "AWS_EC2_METADATA_DISABLED", "value": "true"}
 ]

 No HTTP_PROXY/HTTPS_PROXY/NO_PROXY — correct no-op behavior.

5. Live Cluster — Path B: Proxy Injection — PASS

 Patched CPO with proxy env vars:
 oc set env deployment/control-plane-operator -n clusters-pr9053 -c control-plane-operator \
   HTTP_PROXY=http://test-proxy.example.com:3128 \
   HTTPS_PROXY=http://test-proxy.example.com:3128 \
   NO_PROXY=localhost,127.0.0.1,.cluster.local,.svc,172.30.0.0/16,10.0.0.0/8,.amazonaws.com,quay.io,.quay.io,registry.redhat.io,.redhat.io,.redhat.com

 After CPO reconcile, CCM container has all 6 env vars:
 [
     {"name": "AWS_SHARED_CREDENTIALS_FILE", "value": "/etc/kubernetes/secrets/cloud-provider/credentials"},
     {"name": "AWS_SDK_LOAD_CONFIG", "value": "true"},
     {"name": "AWS_EC2_METADATA_DISABLED", "value": "true"},
     {"name": "HTTP_PROXY", "value": "http://test-proxy.example.com:3128"},
     {"name": "HTTPS_PROXY", "value": "http://test-proxy.example.com:3128"},
     {"name": "NO_PROXY", "value": ".amazonaws.com,.cluster.local,.quay.io,.redhat.com,.redhat.io,.svc,10.0.0.0/8,127.0.0.1,172.30.0.0/16,kube-apiserver,localhost,quay.io,registry.redhat.io"}
 ]

 kube-apiserver auto-appended to NO_PROXY by proxy.SetEnvVars() — expected behavior.

6. Guest Cluster Health — PASS

  • Nodes: 2/2 Ready
  • Cluster operators: 22/22 Available=True

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

/retest-required

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 76220f1 and 2 for PR HEAD 4afcef2 in total

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 4b22cfd and 1 for PR HEAD 4afcef2 in total

@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

@openshift-merge-bot
openshift-merge-bot Bot merged commit 770ebed into openshift:main Jul 29, 2026
43 checks passed
@openshift-ci-robot

Copy link
Copy Markdown

@PoornimaSingour: Jira Issue Verification Checks: Jira Issue OCPBUGS-99288
✔️ This pull request was pre-merge verified.
✔️ All associated pull requests have merged.
✔️ All associated, merged pull requests were pre-merge verified.

Jira Issue OCPBUGS-99288 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓

Details

In response to this:

What this PR does / why we need it:

The AWS Cloud Controller Manager (CCM) deployment was missing HTTP_PROXY, HTTPS_PROXY, and NO_PROXY environment variables when the management cluster is configured with a proxy. This was a regression from the v1 to v2 component framework migration where the proxy.SetEnvVars() call was not carried over.

This PR adds an adaptDeployment function that calls proxy.SetEnvVars() on the CCM container, following the same pattern used by other components (cloud-credential-operator, konnectivity, etc.).

Which issue(s) this PR fixes:

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

Special notes for your reviewer:

  • proxy.SetEnvVars() reads from os.Getenv("HTTP_PROXY") etc., which are inherited from the management cluster's proxy configuration. When no proxy is configured, the function is a no-op.
  • Verified on a live cluster (5.0.0-ec.4) that proxy env vars are correctly injected into the CCM container when the CPO process has proxy env vars set.
  • All 22 guest cluster operators were healthy after the change.

Checklist:

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

Summary by CodeRabbit

  • New Features
  • Added proxy environment variable support to the AWS cloud-controller-manager deployment, automatically configuring HTTP, HTTPS, and no-proxy behavior based on provided values.
  • Bug Fixes
  • Ensured cloud-controller-manager is updated with the correct proxy environment variables (including expected AWS-related proxy configuration behavior).
  • Tests
  • Added unit coverage validating proxy environment variables are applied or omitted correctly across multiple proxy scenarios.

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
Contributor Author

/jira backport release-4.22 release-4.21 /jira backport release-4.20

@openshift-ci-robot

Copy link
Copy Markdown

@PoornimaSingour: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.22 release-4.21 /jira backport release-4.20

Details

In response to this:

/jira backport release-4.22 release-4.21 /jira backport release-4.20

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-cherrypick-robot

Copy link
Copy Markdown

@openshift-ci-robot: new pull request created: #9155

Details

In response to this:

@PoornimaSingour: The following backport issues have been created:

Queuing cherrypicks to the requested branches to be created after this PR merges:
/cherrypick release-4.22 release-4.21 /jira backport release-4.20

In response to this:

/jira backport release-4.22 release-4.21 /jira backport release-4.20

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.

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.

@openshift-merge-robot

Copy link
Copy Markdown
Contributor

Fix included in release 5.0.0-0.nightly-2026-07-29-133253

openshift-merge-bot Bot pushed a commit that referenced this pull request Aug 5, 2026
…r deployment

The CCM deployment was missing HTTP_PROXY, HTTPS_PROXY, and NO_PROXY
environment variables when the management cluster is configured with a
proxy. This was a regression from the v1 to v2 component framework
migration where the proxy.SetEnvVars() call was not carried over.

Adapted for release-4.22: uses support/util instead of support/podspec
(which doesn't exist on this branch). Adds the missing FindEnvVar
helper to support/util/containers.go.

Includes test coverage for full proxy, partial proxy (HTTP_PROXY-only
and HTTPS_PROXY-only), no proxy, and env var preservation scenarios.

This is a manual backport of PR #9053 (commits ec5ae7a, 4afcef2)
adapted for the release-4.22 branch.
openshift-merge-bot Bot pushed a commit that referenced this pull request Aug 11, 2026
…r deployment

The CCM deployment was missing HTTP_PROXY, HTTPS_PROXY, and NO_PROXY
environment variables when the management cluster is configured with a
proxy. This was a regression from the v1 to v2 component framework
migration where the proxy.SetEnvVars() call was not carried over.

Adapted for release-4.22: uses support/util instead of support/podspec
(which doesn't exist on this branch). Adds the missing FindEnvVar
helper to support/util/containers.go.

Includes test coverage for full proxy, partial proxy (HTTP_PROXY-only
and HTTPS_PROXY-only), no proxy, and env var preservation scenarios.

This is a manual backport of PR #9053 (commits ec5ae7a, 4afcef2)
adapted for the release-4.22 branch.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

acknowledge-critical-fixes-only Indicates if the issuer of the label is OK with the policy. 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/platform/aws PR/issue for AWS (AWSPlatform) platform 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. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants