OCPBUGS-99288: Add proxy env vars to AWS cloud-controller-manager deployment - #9053
Conversation
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@PoornimaSingour: This pull request references Jira Issue OCPBUGS-99288, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
📝 WalkthroughWalkthroughThe AWS cloud-controller-manager component now registers a deployment adapter. The adapter targets the cloud-controller-manager container and injects proxy environment variables using Suggested reviewers: 🚥 Pre-merge checks | ✅ 10 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (10 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
89370dd to
747e029
Compare
|
@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
DetailsIn response to this:
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: This pull request references Jira Issue OCPBUGS-99288, which is valid. 3 validation(s) were run on this bug
DetailsIn response to this:
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. |
|
OCPBUGS-99288 — Complete Summary ProblemAWS 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:
Verified on Cluster:
Testing Done
|
Codecov Report❌ Patch coverage is
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
... and 2 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
…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.
747e029 to
ec5ae7a
Compare
jparrill
left a comment
There was a problem hiding this comment.
Dropped a comment, please let me know for tagging. Thanks
| httpsProxy string | ||
| noProxy string | ||
| validate func(*WithT, *corev1.Container) | ||
| }{ |
There was a problem hiding this comment.
The two test cases cover the main paths well. A couple of optional suggestions if you want to strengthen coverage:
-
Partial proxy: What happens when only
HTTP_PROXYis set butHTTPS_PROXYis empty?proxy.SetEnvVarshas a branch for this (if httpProxy != "" || httpsProxy != ""). -
Existing env vars preserved: The CCM manifest already defines
AWS_SHARED_CREDENTIALS_FILE,AWS_SDK_LOAD_CONFIG, andAWS_EC2_METADATA_DISABLED. Might be worth asserting those survive afteradaptDeploymentruns — the CCO tests do something similar.
Neither is blocking, the current coverage is reasonable for a bug fix.
There was a problem hiding this comment.
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>
There was a problem hiding this comment.
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
📒 Files selected for processing (1)
control-plane-operator/controllers/hostedcontrolplane/v2/cloud_controller_manager/aws/deployment_test.go
|
/approve |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/lgtm |
|
/label acknowledge-critical-fixes-only |
|
Scheduling tests matching the |
|
/retest |
|
/test e2e-v2-gke |
|
/verified by @vsolanki12 Verification Report PR #9053Environment
Verification Report for PR #9053Environment
1. Unit Tests PASS (8/8)Test cases:
2. Container Name Validation — PASS3. Pattern Consistency — PASS4. Live Cluster — Path A: No-proxy — PASS5. Live Cluster — Path B: Proxy Injection — PASS6. Guest Cluster Health — PASS
|
|
@vsolanki12: This PR has been marked as verified by DetailsIn response to this:
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. |
|
/retest-required |
|
@PoornimaSingour: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions 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. |
|
@PoornimaSingour: Jira Issue Verification Checks: Jira Issue OCPBUGS-99288 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. 🕓 DetailsIn response to this:
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. |
|
/jira backport release-4.22 release-4.21 /jira backport release-4.20 |
|
@PoornimaSingour: The following backport issues have been created: Queuing cherrypicks to the requested branches to be created after this PR merges: DetailsIn response to this:
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: new pull request created: #9155 DetailsIn response to this:
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. |
|
Fix included in release 5.0.0-0.nightly-2026-07-29-133253 |
…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.
…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.
What this PR does / why we need it:
The AWS Cloud Controller Manager (CCM) deployment was missing
HTTP_PROXY,HTTPS_PROXY, andNO_PROXYenvironment variables when the management cluster is configured with a proxy. This was a regression from the v1 to v2 component framework migration where theproxy.SetEnvVars()call was not carried over.This PR adds an
adaptDeploymentfunction that callsproxy.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 fromos.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.Checklist:
Summary by CodeRabbit