Skip to content

WIP: CNTRLPLANE-3789: Add e2e tests for component-scoped proxy - #949

Open
tchap wants to merge 2 commits into
openshift:masterfrom
tchap:disconnected-env-e2e
Open

WIP: CNTRLPLANE-3789: Add e2e tests for component-scoped proxy#949
tchap wants to merge 2 commits into
openshift:masterfrom
tchap:disconnected-env-e2e

Conversation

@tchap

@tchap tchap commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

Introduce a new test/e2e-component-proxy suite gated behind the
AuthenticationComponentProxy feature gate with five Serial tests:

  • A1: OIDC IdP validation through component proxy (HTTP and HTTPS
    with trustedCA variants)
  • A2: graceful fallback when spec.proxy is removed
  • C1: Degraded condition when spec.proxy points to an unreachable host
  • C2: IdPEndpointUnreachable warning event when an IdP issuer is
    unreachable through the proxy (without going Degraded)

Add test/library/proxy.go with shared helpers: DeploySquidProxy
(RHEL 10 Squid image, HTTP+HTTPS, self-signed TLS), NetworkPolicy
deployment, proxy log retrieval with time filtering,
SaveAndRestoreProxyConfig, VerifyOAuthServerDeploymentProxyConfig,
VerifyTrustedCAConfigMapSynced, and CheckFeatureGateEnabledOrSkip.

Split AddKeycloakIDP into DeployKeycloak and AddKeycloakOIDCIdP so
tests can control ordering — deploy Keycloak, apply NetworkPolicy,
set the proxy, then register the IdP. AddKeycloakIDP remains as a
convenience wrapper.

Summary by CodeRabbit

  • New Features
    • Added component-scoped HTTP proxy support driven by the Authentication resource, including feature-gated trusted-CA bundles and merged/deduplicated NO_PROXY handling.
    • OAuth endpoint and custom route checks now use the resolved proxy settings.
  • Bug Fixes
    • Improved reachability validation through the configured proxy (including trusted proxy CA), with clearer failure reporting and more accurate external IdP connectivity warnings.
    • OAuth server proxy/CA updates are applied and reflected in running pods more reliably.
  • Tests
    • Expanded unit coverage for proxy/transport resolution and proxy-based IdP connectivity.
    • Added serial end-to-end coverage for component-proxy scenarios (proxy success, fallback, degraded, and warning cases).

@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 added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jul 16, 2026
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review

Walkthrough

The operator resolves feature-gated component proxy settings and trusted CA references, applies them to transports, controller checks, OAuth deployments, and configuration observation, and adds serial component-proxy end-to-end coverage.

Changes

Component proxy integration

Layer / File(s) Summary
Proxy resolution and transport contracts
pkg/controllers/common/*, pkg/transport/*, pkg/internal/transporttest/*
Adds feature-gated proxy resolution, merged NO_PROXY defaults, multi-reference CA loading, proxy-aware transports, and transport test helpers.
Configuration observation and identity-provider transport
pkg/controllers/configobservation/*
Propagates authentication listers and feature gates, builds proxy-aware identity-provider transports, and observes the trusted CA bundle path.
Proxy-aware controller validation
pkg/controllers/customroute/*, pkg/controllers/oauthendpoints/*, pkg/controllers/proxyconfig/*, pkg/libs/endpointaccessible/*
Routes route, endpoint, health, and external identity-provider checks through resolved proxy and trusted CA settings.
OAuth deployment proxy and CA synchronization
pkg/controllers/deployment/*
Uses resolved proxy values for OAuth deployment environment variables and synchronizes the trusted proxy CA ConfigMap into the OAuth deployment.
Operator wiring and component-proxy validation
pkg/operator/*, cmd/cluster-authentication-operator-tests-ext/main.go, test/e2e-component-proxy/*, test/library/*, test-data/apply-configuration/*, go.mod
Wires controller dependencies, registers the serial component-proxy suite, adds E2E scenarios and helpers, updates expected output, and bumps the API dependency.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant AuthenticationCR
  participant ProxyConfigController
  participant OAuthDeploymentController
  participant OAuthServer
  AuthenticationCR->>ProxyConfigController: update component proxy
  ProxyConfigController->>ProxyConfigController: resolve proxy and validate IdP connectivity
  AuthenticationCR->>OAuthDeploymentController: provide proxy and TrustedCAName
  OAuthDeploymentController->>OAuthServer: update proxy environment and mounted CA
Loading

Possibly related PRs

Suggested labels: jira/valid-reference

Suggested reviewers: ardaguclu, gangwgr


Important

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

❌ Failed checks (1 error, 4 warnings, 1 inconclusive)

Check name Status Explanation Resolution
No-Sensitive-Data-In-Logs ❌ Error The PR logs raw proxy/issuer URLs and IdP endpoint strings in Ginkgo/klog messages, exposing internal hostnames/URLs. Redact or drop raw URLs/hostnames from logs; avoid printing proxyURL, issuerURL, event.Message, or endpointURL/noProxy values, and log only coarse statuses.
Docstring Coverage ⚠️ Warning Docstring coverage is 42.25% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning FAIL: the new component-proxy Ginkgo specs depend on helper funcs in test/library/proxy.go that still panic, so the suite isn't runnable or consistent with the repo. Implement DeploySquidProxy/WaitForSquidProxyTraffic/Verify* helpers (or remove the suite from the registry until they exist), then rerun the e2e specs.
Microshift Test Compatibility ⚠️ Warning The new Ginkgo suite uses MicroShift-unsupported OpenShift APIs (operator.openshift.io Authentication, config.openshift.io ClusterOperator/OAuth) and has no MicroShift skip/guard. Add a [Skipped:MicroShift] label or appropriate [apigroup:...] tag(s), or guard with exutil.IsMicroShiftCluster()+g.Skip() before these tests run.
Ipv6 And Disconnected Network Test Compatibility ⚠️ Warning FAIL: the new component-proxy e2e suite deploys Keycloak from quay.io/keycloak/keycloak:25.0, requiring a public image pull in disconnected CI. Mirror the image in an internal registry or mark the suite [Skipped:Disconnected]; then verify IPv6 handling in the serial IPv6 payload job.
Container-Privileges ❓ Inconclusive placeholder Need code evidence first.
✅ Passed checks (9 passed)
Check name Status Explanation
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 only Ginkgo titles are static strings; none include generated names, timestamps, or other run-to-run dynamic values.
Single Node Openshift (Sno) Test Compatibility ✅ Passed The new e2e tests only exercise proxy/IdP flows and single-replica pod deploys; no node-count, scheduling, drain, or topology assumptions were found.
Topology-Aware Scheduling Compatibility ✅ Passed No new topology-sensitive scheduling rules were introduced; changes are proxy/CA plumbing and e2e tests, while existing deployment placement logic is unchanged.
Ote Binary Stdout Contract ✅ Passed New OTE entrypoint code logs to stderr, and the added component-proxy suite only uses GinkgoWriter inside It blocks; no new process-level stdout writes were introduced.
No-Weak-Crypto ✅ Passed No MD5/SHA1/DES/RC4/3DES/Blowfish/ECB, custom crypto, or secret/token comparisons were added; only SHA-256/512 and cert/string checks appear.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: adding e2e tests for the component-scoped proxy.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@openshift-ci
openshift-ci Bot requested review from ardaguclu and gangwgr July 16, 2026 13:38

@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: 10

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
pkg/controllers/configobservation/oauth/idp_conversions.go (1)

318-332: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Bound both OIDC probes with request deadlines.

A proxy that accepts the connection but never responds can indefinitely pin the configuration-observer worker.

  • pkg/controllers/configobservation/oauth/idp_conversions.go#L318-L332: create the discovery request with a timeout context before calling RoundTrip.
  • pkg/controllers/configobservation/oauth/idp_conversions.go#L376-L424: apply a timeout context to the token request, optionally backed by an http.Client.Timeout.

As per path instructions, use “context.Context for cancellation and timeouts.”

🤖 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/controllers/configobservation/oauth/idp_conversions.go` around lines 318
- 332, Bound both OIDC HTTP probes using context.Context cancellation and
timeouts: in discoverOpenIDURLs, create the discovery request with a timeout
context before rt.RoundTrip; in the token-request flow covering lines 376-424,
apply an equivalent timeout context and optionally configure
http.Client.Timeout. Update both affected sites in
pkg/controllers/configobservation/oauth/idp_conversions.go (318-332 and
376-424), preserving existing request behavior while ensuring unresponsive
proxies cannot block indefinitely.

Source: Path instructions

pkg/controllers/proxyconfig/proxyconfig_controller.go (1)

59-90: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Watch every lister-backed input used by validation.

OAuth changes and updates to the component proxy’s dynamic openshift-config/<trustedCAName> ConfigMap do not enqueue this controller, leaving validation stale until the 60-minute resync. Accept the OAuth informer and the openshift-config ConfigMap informer, then register both with WithInformers; update the starter.go wiring accordingly.

🤖 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/controllers/proxyconfig/proxyconfig_controller.go` around lines 59 - 90,
The proxyConfigChecker controller currently watches only routes, auth
configuration, operator authentication, and selected CA ConfigMaps, so
validation inputs from OAuth and the dynamic openshift-config trusted-CA
ConfigMap can remain stale. Update the controller factory and its starter.go
wiring to accept the OAuth informer and the openshift-config ConfigMap informer,
register both with WithInformers, and preserve the existing filtered ConfigMap
watches.
🤖 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 `@cmd/cluster-authentication-operator-tests-ext/main.go`:
- Around line 89-97: The existing operator serial suite selector also matches
component-proxy tests, causing duplicate execution. Update its qualifier in the
existing serial suite registration to exclude names containing
“[ComponentProxy]”, while leaving the dedicated component-proxy suite selector
unchanged.

In `@pkg/controllers/common/proxy.go`:
- Around line 101-104: Update mergeNoProxy to sort the combined entries
deterministically before joining them, replacing the unordered UnsortedList flow
with an ordered list while preserving all existing entries and comma-separated
output.

In `@pkg/controllers/configobservation/oauth/observe_proxy_trusted_ca_test.go`:
- Around line 188-190: Update the test assertion around the observed
configuration to compare tt.expected directly with observed, removing the
NestedString extraction and ignored error returns. Preserve the test’s existing
assertion framework while validating the complete configuration, including
fallback fields.

In `@pkg/controllers/customroute/custom_route_conditions.go`:
- Around line 165-171: Update the trusted CA handling around
transport.LoadCAData in the custom route conditions flow to check the boolean
result from rootCAs.AppendCertsFromPEM(caData). When no certificate is parsed,
return a configuration error for the invalid trusted proxy CA bundle instead of
continuing; preserve the existing load error propagation and successful append
behavior.

In `@pkg/controllers/deployment/deployment_controller.go`:
- Around line 382-392: Update the ConfigMap construction in the trusted CA copy
flow to preserve both sourceCM.Data and sourceCM.BinaryData when creating
targetCM. Keep the existing namespace, name, and apply behavior in the
surrounding deployment controller logic unchanged.

In `@pkg/controllers/proxyconfig/proxyconfig_controller.go`:
- Around line 143-150: Update the no-IdP branch in the validation flow around
extractIdPURLs to clear p.lastIdPValidationHash before returning. Keep the
existing early return, and preserve hash comparison behavior when at least one
IdP remains.

In `@pkg/transport/transport_test.go`:
- Around line 303-308: Do not ignore test fixture insertion errors: in
pkg/transport/transport_test.go:303-308, update newConfigMapLister to accept
*testing.T and assert each indexer.Add result; in
pkg/controllers/common/proxy_test.go:352-357, replace the discarded
Authentication fixture insertion error with an assertion using the test handle.
Preserve the existing fixture setup and lister behavior.

In `@pkg/transport/transport.go`:
- Around line 51-58: Update the CA aggregation loop around LoadCAData so each
ConfigMap value is separated from the next PEM bundle by an explicit newline,
including when the loaded data lacks a trailing newline. Preserve the existing
error propagation and append all certificate data into caData.
- Around line 60-62: Update the no-component-proxy branch in TransportFor to
return a transport with proxy resolution disabled, rather than delegating to the
default environment-aware transport. Preserve the existing behavior for
configurations that provide CA data or HTTP/HTTPS proxy settings.

In `@test/e2e-component-proxy/component_proxy.go`:
- Around line 63-65: Update the error branch in the authentication GET flow
within the component proxy test to propagate the returned API error instead of
returning a nil error. Preserve the existing false result while passing err
through to the caller so cleanup failures are reported immediately.

---

Outside diff comments:
In `@pkg/controllers/configobservation/oauth/idp_conversions.go`:
- Around line 318-332: Bound both OIDC HTTP probes using context.Context
cancellation and timeouts: in discoverOpenIDURLs, create the discovery request
with a timeout context before rt.RoundTrip; in the token-request flow covering
lines 376-424, apply an equivalent timeout context and optionally configure
http.Client.Timeout. Update both affected sites in
pkg/controllers/configobservation/oauth/idp_conversions.go (318-332 and
376-424), preserving existing request behavior while ensuring unresponsive
proxies cannot block indefinitely.

In `@pkg/controllers/proxyconfig/proxyconfig_controller.go`:
- Around line 59-90: The proxyConfigChecker controller currently watches only
routes, auth configuration, operator authentication, and selected CA ConfigMaps,
so validation inputs from OAuth and the dynamic openshift-config trusted-CA
ConfigMap can remain stale. Update the controller factory and its starter.go
wiring to accept the OAuth informer and the openshift-config ConfigMap informer,
register both with WithInformers, and preserve the existing filtered ConfigMap
watches.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 35b76f36-3286-4f09-8779-6c1a053e7f71

📥 Commits

Reviewing files that changed from the base of the PR and between 86b98f9 and 6dfa3bd.

⛔ Files ignored due to path filters (55)
  • go.sum is excluded by !**/*.sum
  • vendor/github.com/openshift/api/.golangci.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/Makefile is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/apps/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/authorization/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/build/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/cloudnetwork/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/register.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_cluster_version.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_crio_credential_provider_config.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_infrastructure.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/types_network.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1/zz_generated.model_name.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1alpha1/types_cluster_monitoring.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/config/v1alpha1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/config/v1alpha1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/features.md is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/features/features.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/image/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/network/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/networkoperator/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/oauth/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/types_authentication.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/types_csi_cluster_driver.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/types_ingresscontroller.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_authentication_01_authentications-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_csi-driver_01_clustercsidrivers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-CustomNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-Default.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-DevPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-OKD.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.crd-manifests/0000_50_ingress_00_ingresscontrollers-TechPreviewNoUpgrade.crd.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/operator/v1/zz_generated.deepcopy.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1/zz_generated.featuregated-crd-manifests.yaml is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1/zz_generated.model_name.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/operator/v1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/osin/v1/types.go is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/osin/v1/zz_generated.swagger_doc_generated.go is excluded by !**/vendor/**, !vendor/**, !**/zz_generated*
  • vendor/github.com/openshift/api/project/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/quota/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/route/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/samples/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/security/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/template/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/github.com/openshift/api/user/.codegen.yaml is excluded by !**/vendor/**, !vendor/**
  • vendor/modules.txt is excluded by !**/vendor/**, !vendor/**
📒 Files selected for processing (31)
  • cmd/cluster-authentication-operator-tests-ext/main.go
  • go.mod
  • pkg/controllers/common/proxy.go
  • pkg/controllers/common/proxy_test.go
  • pkg/controllers/configobservation/configobservercontroller/observe_config_controller.go
  • pkg/controllers/configobservation/interfaces.go
  • pkg/controllers/configobservation/oauth/idp_conversions.go
  • pkg/controllers/configobservation/oauth/idp_conversions_test.go
  • pkg/controllers/configobservation/oauth/observe_idps.go
  • pkg/controllers/configobservation/oauth/observe_idps_test.go
  • pkg/controllers/configobservation/oauth/observe_proxy_trusted_ca.go
  • pkg/controllers/configobservation/oauth/observe_proxy_trusted_ca_test.go
  • pkg/controllers/customroute/custom_route_conditions.go
  • pkg/controllers/customroute/custom_route_controller.go
  • pkg/controllers/deployment/default_deployment.go
  • pkg/controllers/deployment/deployment_controller.go
  • pkg/controllers/deployment/deployment_controller_test.go
  • pkg/controllers/oauthendpoints/oauth_endpoints_controller.go
  • pkg/controllers/proxyconfig/proxyconfig_controller.go
  • pkg/controllers/proxyconfig/proxyconfig_controller_test.go
  • pkg/internal/transporttest/transporttest.go
  • pkg/libs/endpointaccessible/endpoint_accessible_controller.go
  • pkg/operator/replacement_starter.go
  • pkg/operator/starter.go
  • pkg/transport/transport.go
  • pkg/transport/transport_test.go
  • test-data/apply-configuration/overall/minimal-cluster/expected-output/UserWorkload/Create/cluster-scoped-resources/certificates.k8s.io/certificatesigningrequests/9806-body-system-COLON-openshift-COLON-openshift-authenticator-.yaml
  • test-data/apply-configuration/overall/minimal-cluster/expected-output/UserWorkload/Create/cluster-scoped-resources/certificates.k8s.io/certificatesigningrequests/9806-metadata-system-COLON-openshift-COLON-openshift-authenticator-.yaml
  • test-data/apply-configuration/overall/oauth-server-creation-minimal/expected-output/Management/Create/namespaces/openshift-authentication/apps/deployments/b3b2-body-oauth-openshift.yaml
  • test-data/apply-configuration/overall/oauth-server-creation-minimal/expected-output/Management/Create/namespaces/openshift-authentication/apps/deployments/b3b2-metadata-oauth-openshift.yaml
  • test/e2e-component-proxy/component_proxy.go

Comment thread cmd/cluster-authentication-operator-tests-ext/main.go Outdated
Comment thread pkg/controllers/common/proxy.go Outdated
Comment thread pkg/controllers/configobservation/oauth/observe_proxy_trusted_ca_test.go Outdated
Comment thread pkg/controllers/customroute/custom_route_conditions.go Outdated
Comment thread pkg/controllers/deployment/deployment_controller.go Outdated
Comment thread pkg/controllers/proxyconfig/proxyconfig_controller.go
Comment thread pkg/transport/transport_test.go
Comment thread pkg/transport/transport.go Outdated
Comment thread pkg/transport/transport.go Outdated
Comment thread test/e2e-component-proxy/component_proxy.go Outdated

@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: 3

🤖 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 `@test/e2e-component-proxy/component_proxy.go`:
- Line 119: Remove the g.GinkgoWriter.Printf call that logs proxyURL, or replace
its value with a non-sensitive redacted indicator so the in-cluster proxy
hostname is never written to test artifacts.
- Around line 135-136: Handle and propagate or explicitly fail on the error
returned by the Secrets(...).Delete call in the cleanup flow, rather than
discarding it with “_”. Ensure cleanup reports the deletion failure so leftover
cluster state cannot contaminate subsequent tests.

In `@test/library/proxy.go`:
- Around line 14-16: The proxy helper functions in test/library/proxy.go are
still placeholders and cause the e2e suite to panic. Implement DeploySquidProxy
and every other exported helper in the file according to their declared
contracts, including proxy setup, returned namespace/URL values, and cleanup
behavior, so the tests can execute without panics.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 33c9dd03-651b-4433-a7b0-db01e6b8c2bc

📥 Commits

Reviewing files that changed from the base of the PR and between 6dfa3bd and df52e7a.

📒 Files selected for processing (2)
  • test/e2e-component-proxy/component_proxy.go
  • test/library/proxy.go

Comment thread test/e2e-component-proxy/component_proxy.go
Comment thread test/e2e-component-proxy/component_proxy.go
Comment thread test/library/proxy.go Outdated
@openshift-ci openshift-ci Bot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 20, 2026
@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign xueqzhan 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 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: 3

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/e2e-component-proxy/component_proxy.go (1)

229-231: 🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win

Return event-list failures from the polling callback.

Line 231 converts an API failure into another retry, hiding the cause for up to ten minutes. Return err so the test fails immediately.

Proposed fix
 		if err != nil {
 			g.GinkgoWriter.Printf("failed to list events: %v\n", err)
-			return false, nil
+			return false, err
 		}

As per path instructions, “Never ignore error returns.”

🤖 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 `@test/e2e-component-proxy/component_proxy.go` around lines 229 - 231, Update
the event-list error branch in the polling callback to return the encountered
err instead of returning false, nil. Preserve the existing failure log and
successful polling behavior so API failures propagate immediately and stop
retries.

Source: Path instructions

♻️ Duplicate comments (1)
test/library/proxy.go (1)

52-93: 🩺 Stability & Availability | 🔴 Critical | 🏗️ Heavy lift

Implement the proxy helpers before these specs run.

The helpers still panic. CheckFeatureGateEnabledOrSkip runs before setup in every new spec, so all registered Component Proxy tests abort immediately; the Squid, NetworkPolicy, deployment-verification, and traffic helpers block the remaining assertions too.

🤖 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 `@test/library/proxy.go` around lines 52 - 93, Implement all proxy helper
functions in test/library/proxy.go instead of leaving them as panics, including
CheckFeatureGateEnabledOrSkip before test setup and the Squid deployment,
NetworkPolicy, OAuth environment, logs, traffic-wait, deployment-verification,
and trusted-CA sync helpers. Use the provided Kubernetes clients to perform the
documented operations, assertions, cleanup, and feature-gate skip behavior so
all Component Proxy specs can execute.
🤖 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 `@test/e2e-component-proxy/component_proxy.go`:
- Line 55: Remove or redact the internal endpoint values logged by the component
proxy test, including proxyURL in the GinkgoWriter output and
kcClient.IssuerURL() at the additionally affected log site. Preserve useful
diagnostic context without exposing in-cluster hostnames.

In `@test/library/proxy.go`:
- Around line 20-21: Update SaveAndRestoreProxyConfig to replace context.TODO()
with separate deadline-bound contexts for the initial configuration snapshot and
the cleanup restore path. Apply each timeout context to its corresponding
GET/UPDATE calls, ensure cancellation is handled, and keep cleanup bounded even
if the API stalls.
- Around line 31-47: Update the cleanup logic around the Authentication proxy
restoration to call t.Errorf instead of t.Logf when fetching the resource,
updating its proxy, or waiting via WaitForOperatorToPickUpChanges fails.
Preserve the existing early returns, but ensure each failure marks the spec as
failed so proxy restoration or reconciliation errors cannot leave later tests
poisoned.

---

Outside diff comments:
In `@test/e2e-component-proxy/component_proxy.go`:
- Around line 229-231: Update the event-list error branch in the polling
callback to return the encountered err instead of returning false, nil. Preserve
the existing failure log and successful polling behavior so API failures
propagate immediately and stop retries.

---

Duplicate comments:
In `@test/library/proxy.go`:
- Around line 52-93: Implement all proxy helper functions in
test/library/proxy.go instead of leaving them as panics, including
CheckFeatureGateEnabledOrSkip before test setup and the Squid deployment,
NetworkPolicy, OAuth environment, logs, traffic-wait, deployment-verification,
and trusted-CA sync helpers. Use the provided Kubernetes clients to perform the
documented operations, assertions, cleanup, and feature-gate skip behavior so
all Component Proxy specs can execute.
🪄 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: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 4288bd75-d622-46e5-a4a2-38bd1f58545a

📥 Commits

Reviewing files that changed from the base of the PR and between df52e7a and ba345bb.

📒 Files selected for processing (2)
  • test/e2e-component-proxy/component_proxy.go
  • test/library/proxy.go

Comment thread test/e2e-component-proxy/component_proxy.go Outdated
Comment thread test/library/proxy.go
Comment thread test/library/proxy.go Outdated

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
test/e2e-component-proxy/component_proxy.go (1)

265-288: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

proxyCleanup is reassigned, so the Squid proxy is never cleaned up.

Line 265 binds proxyCleanup to the Squid cleanup, and the DeferCleanup at Lines 266-269 closes over that variable. Line 273 uses := with operatorAuth (the only new name) in the same block scope, so it reassigns proxyCleanup to the SaveAndRestoreProxyConfig cleanup rather than declaring a new variable. As a result the "removing Squid proxy" deferred closure invokes the restore function instead, the Squid deployment is never torn down (resource leak that can contaminate subsequent serial tests), and the restore cleanup runs twice (Lines 269 and 287).

🐛 Proposed fix: use a distinct name for the restore cleanup
 	g.By("Saving original proxy config for cleanup")
-	operatorAuth, proxyCleanup := test.SaveAndRestoreProxyConfig(t, clients.OperatorClient, clients.ConfigClient)
+	operatorAuth, proxyRestore := test.SaveAndRestoreProxyConfig(t, clients.OperatorClient, clients.ConfigClient)
@@
 		g.GinkgoWriter.Println("cleaning up: deleting fake IdP secret")
 		_ = clients.KubeClient.CoreV1().Secrets("openshift-config").Delete(ctx, fakeIDPSecretName, metav1.DeleteOptions{})
 
-		proxyCleanup()
+		proxyRestore()
 	})
🤖 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 `@test/e2e-component-proxy/component_proxy.go` around lines 265 - 288, Rename
the cleanup returned by SaveAndRestoreProxyConfig in the operatorAuth setup to a
distinct symbol, such as a proxy-config restore cleanup, so it does not reassign
the Squid proxy cleanup captured by the first DeferCleanup. Update the later
deferred cleanup to invoke the renamed restore function, while leaving the
original proxyCleanup closure responsible only for deleting the Squid proxy.
🤖 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.

Outside diff comments:
In `@test/e2e-component-proxy/component_proxy.go`:
- Around line 265-288: Rename the cleanup returned by SaveAndRestoreProxyConfig
in the operatorAuth setup to a distinct symbol, such as a proxy-config restore
cleanup, so it does not reassign the Squid proxy cleanup captured by the first
DeferCleanup. Update the later deferred cleanup to invoke the renamed restore
function, while leaving the original proxyCleanup closure responsible only for
deleting the Squid proxy.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 44fdc303-375b-4320-a04d-9ddb59cb0e85

📥 Commits

Reviewing files that changed from the base of the PR and between ba345bb and 71e1520.

📒 Files selected for processing (3)
  • test/e2e-component-proxy/component_proxy.go
  • test/library/keycloakidp.go
  • test/library/proxy.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • test/library/proxy.go

@tchap
tchap force-pushed the disconnected-env-e2e branch from 1575d36 to ce6e2da Compare July 21, 2026 10:31
@openshift-ci openshift-ci Bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 21, 2026
@tchap
tchap force-pushed the disconnected-env-e2e branch 8 times, most recently from cadb1d6 to 24d0588 Compare July 29, 2026 10:34
@tchap

tchap commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

/retitle CNTRLPLANE-3789: Add e2e tests for component-scoped proxy

@openshift-ci openshift-ci Bot changed the title WIP: E2E tests for the Component Proxy CNTRLPLANE-3789: Add e2e tests for component-scoped proxy Jul 29, 2026
@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 29, 2026
@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 29, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@tchap: This pull request references CNTRLPLANE-3789 which is a valid jira issue.

Details

In response to this:

Introduce a new test/e2e-component-proxy suite gated behind the
AuthenticationComponentProxy feature gate with five Serial tests:

  • A1: OIDC IdP validation through component proxy (HTTP and HTTPS
    with trustedCA variants)
  • A2: graceful fallback when spec.proxy is removed
  • C1: Degraded condition when spec.proxy points to an unreachable host
  • C2: IdPEndpointUnreachable warning event when an IdP issuer is
    unreachable through the proxy (without going Degraded)

Add test/library/proxy.go with shared helpers: DeploySquidProxy
(RHEL 10 Squid image, HTTP+HTTPS, self-signed TLS), NetworkPolicy
deployment, proxy log retrieval with time filtering,
SaveAndRestoreProxyConfig, VerifyOAuthServerDeploymentProxyConfig,
VerifyTrustedCAConfigMapSynced, and CheckFeatureGateEnabledOrSkip.

Split AddKeycloakIDP into DeployKeycloak and AddKeycloakOIDCIdP so
tests can control ordering — deploy Keycloak, apply NetworkPolicy,
set the proxy, then register the IdP. AddKeycloakIDP remains as a
convenience wrapper.

Summary by CodeRabbit

  • New Features
  • Added component-scoped HTTP proxy support driven by the Authentication resource, including feature-gated trusted-CA bundles and merged/deduplicated NO_PROXY handling.
  • OAuth endpoint and custom route checks now use the resolved proxy settings.
  • Bug Fixes
  • Improved reachability validation through the configured proxy (including trusted proxy CA), with clearer failure reporting and more accurate external IdP connectivity warnings.
  • OAuth server proxy/CA updates are applied and reflected in running pods more reliably.
  • Tests
  • Expanded unit coverage for proxy/transport resolution and proxy-based IdP connectivity.
  • Added serial end-to-end coverage for component-proxy scenarios (proxy success, fallback, degraded, and warning cases).

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.

@tchap
tchap force-pushed the disconnected-env-e2e branch from 24d0588 to f46122e Compare July 29, 2026 10:41
@tchap
tchap marked this pull request as draft July 29, 2026 10:41
@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 29, 2026
@tchap
tchap force-pushed the disconnected-env-e2e branch from f46122e to b58806f Compare July 29, 2026 10:54
Introduce a new test/e2e-component-proxy suite gated behind the
AuthenticationComponentProxy feature gate with five Serial tests:

- A1: OIDC IdP validation through component proxy (HTTP and HTTPS
  with trustedCA variants)
- A2: graceful fallback when spec.proxy is removed
- C1: Degraded condition when spec.proxy points to an unreachable host
- C2: IdPEndpointUnreachable warning event when an IdP issuer is
  unreachable through the proxy (without going Degraded)

Add test/library/proxy.go with shared helpers: DeploySquidProxy
(RHEL 10 Squid image, HTTP+HTTPS, self-signed TLS), NetworkPolicy
deployment, proxy log retrieval with time filtering,
SaveAndRestoreProxyConfig, VerifyOAuthServerDeploymentProxyConfig,
VerifyTrustedCAConfigMapSynced, and CheckFeatureGateEnabledOrSkip.

Split AddKeycloakIDP into DeployKeycloak and AddKeycloakOIDCIdP so
tests can control ordering — deploy Keycloak, apply NetworkPolicy,
set the proxy, then register the IdP. AddKeycloakIDP remains as a
convenience wrapper.
@tchap
tchap force-pushed the disconnected-env-e2e branch from 417f1c9 to 7bafc12 Compare July 29, 2026 11:11
When all IdPs were removed from the OAuth config, the stale
lastIdPValidationHash was preserved. Re-adding the same IdPs with
the same proxy config produced a matching hash, causing
validateIdPConnectivity to skip validation entirely.

Clear the hash in the no-IdP early return so re-added IdPs are
always validated.
@tchap
tchap force-pushed the disconnected-env-e2e branch from 7bafc12 to 9bd8a65 Compare July 29, 2026 11:34
@tchap
tchap marked this pull request as ready for review July 29, 2026 12:29
@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 29, 2026
@openshift-ci
openshift-ci Bot requested a review from xueqzhan July 29, 2026 12:29
@tchap

tchap commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

/retitle WIP: CNTRLPLANE-3789: Add e2e tests for component-scoped proxy

@openshift-ci openshift-ci Bot changed the title CNTRLPLANE-3789: Add e2e tests for component-scoped proxy WIP: CNTRLPLANE-3789: Add e2e tests for component-scoped proxy Jul 29, 2026
@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 29, 2026
@openshift-ci

openshift-ci Bot commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants