OCPBUGS-60993: Enrich IBI config image proxy NoProxy with cluster networks#10543
OCPBUGS-60993: Enrich IBI config image proxy NoProxy with cluster networks#10543carbonin wants to merge 1 commit intoopenshift:mainfrom
Conversation
Automatically add cluster, service, and machine network CIDRs to the proxy NoProxy field during image-based installation. This ensures internal cluster communication bypasses the proxy, preventing an additional node reboot that occurs when these networks aren't explicitly included in the install-config.yaml. The enrichment adds: - Essential values (localhost, 127.0.0.1, .svc, .cluster.local) - All service network CIDRs - All machine network CIDRs - All cluster network (pod) CIDRs - User-provided NoProxy values (deduplicated) Resolves https://redhat.atlassian.net/browse/OCPBUGS-60993 Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
WalkthroughThe PR enriches the Proxy configuration's NoProxy field during cluster configuration generation. A new ChangesProxy Enrichment Logic
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes 🚥 Pre-merge checks | ✅ 11 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (11 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.1)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
pkg/asset/imagebased/configimage/clusterconfiguration_test.go (1)
39-220: ⚡ Quick winAdd explicit tests for wildcard and input-normalization branches in
enrichNoProxy.Current cases cover the happy path, but not
NoProxy == "*"and duplicate/whitespace-heavy user input normalization. Adding both will harden regression coverage for the new helper.💡 Suggested test additions
func TestClusterConfiguration_Generate(t *testing.T) { cases := []struct { ... }{ + { + name: "valid configuration with proxy wildcard noProxy", + dependencies: []asset.Asset{ + clusterID(), kubeadminPassword(), lbCertKey(), localhostCertKey(), + serviceNetworkCertKey(), adminKubeConfigCertKey(), ingressCertKey(), + installConfig().proxy(&types.Proxy{ + HTTPProxy: "http://10.10.10.11:80", + HTTPSProxy: "http://my-lab-proxy.org:443", + NoProxy: "*", + }).build(), + imageBasedConfig(), + }, + expectedConfig: clusterConfiguration().proxy(&types.Proxy{ + HTTPProxy: "http://10.10.10.11:80", + HTTPSProxy: "http://my-lab-proxy.org:443", + NoProxy: "*", + }).build().Config, + }, + { + name: "valid configuration with proxy duplicate and spaced noProxy", + dependencies: []asset.Asset{ + ... installConfig().proxy(&types.Proxy{ + HTTPProxy: "http://10.10.10.11:80", + HTTPSProxy: "http://my-lab-proxy.org:443", + NoProxy: " internal.com,internal.com, , localhost ", + }).build(), + ... + }, + expectedConfig: clusterConfiguration().proxy(enrichedProxy()).build().Config, + }, } }🤖 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 `@pkg/asset/imagebased/configimage/clusterconfiguration_test.go` around lines 39 - 220, Add two new table-driven cases to TestClusterConfiguration_Generate exercising enrichNoProxy: one where the InstallConfig proxy's NoProxy is the wildcard "*" and one where NoProxy contains duplicate entries/extra whitespace (e.g. "a, a , b,,"). For each case, include the same standard dependencies but set installConfig().proxy(proxyWithCustomNoProxy("<value>")).build() (or reuse proxy() but modify its NoProxy), then set expectedConfig to the clusterConfiguration().proxy(enrichedProxyWithNormalizedNoProxy("<expected>")).build().Config and assert equality the same way existing cases do; reference the enrichNoProxy helper by name and reuse proxy(), enrichedProxy() patterns so the test verifies both the wildcard branch and the input-normalization branch.
🤖 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 `@pkg/asset/imagebased/configimage/clusterconfiguration_test.go`:
- Around line 39-220: Add two new table-driven cases to
TestClusterConfiguration_Generate exercising enrichNoProxy: one where the
InstallConfig proxy's NoProxy is the wildcard "*" and one where NoProxy contains
duplicate entries/extra whitespace (e.g. "a, a , b,,"). For each case, include
the same standard dependencies but set
installConfig().proxy(proxyWithCustomNoProxy("<value>")).build() (or reuse
proxy() but modify its NoProxy), then set expectedConfig to the
clusterConfiguration().proxy(enrichedProxyWithNormalizedNoProxy("<expected>")).build().Config
and assert equality the same way existing cases do; reference the enrichNoProxy
helper by name and reuse proxy(), enrichedProxy() patterns so the test verifies
both the wildcard branch and the input-normalization branch.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: b80db09c-f43a-45c5-a806-5e1ede7337ba
📒 Files selected for processing (2)
pkg/asset/imagebased/configimage/clusterconfiguration.gopkg/asset/imagebased/configimage/clusterconfiguration_test.go
|
/hold holding until we can do manual testing |
Automatically add cluster, service, and machine network CIDRs to the proxy NoProxy field during image-based installation. This ensures internal cluster communication bypasses the proxy, preventing an additional node reboot that occurs when these networks aren't explicitly included in the install-config.yaml.
The enrichment adds:
Resolves https://redhat.atlassian.net/browse/OCPBUGS-60993
/cc @omertuc
Summary by CodeRabbit
Release Notes