Skip to content

OCPBUGS-74511: remove RouteExternalCertificate feature gate#604

Open
jcmoraisjr wants to merge 2 commits intoopenshift:mainfrom
jcmoraisjr:OCPBUGS-74511-remove-featuregate
Open

OCPBUGS-74511: remove RouteExternalCertificate feature gate#604
jcmoraisjr wants to merge 2 commits intoopenshift:mainfrom
jcmoraisjr:OCPBUGS-74511-remove-featuregate

Conversation

@jcmoraisjr
Copy link
Member

@jcmoraisjr jcmoraisjr commented Feb 10, 2026

RouteExternalCertificate is now enabled by default. This update is removing references to this feature gate, hardcoding its value to true. This update is also a pre-requisite to remove it from openshift/cluster-ingress-operator.

Summary by CodeRabbit

  • Refactor
    • External certificate support for routes is now always enabled. The previous configurable flag/feature-gate and its associated configuration surface have been removed, simplifying route configuration and validation behavior.
  • Tests
    • Updated and removed tests to reflect the always-enabled external certificate behavior and the reduced configuration surface.

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels Feb 10, 2026
@openshift-ci-robot
Copy link

@jcmoraisjr: This pull request references Jira Issue OCPBUGS-74511, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @melvinjoseph86

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

RouteExternalCertificate is now enabled by default. This update is removing references to this feature gate, hardcoding its value to true. This update is also a pre-requisite to remove it from openshift/cluster-ingress-operator.

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
Copy link

coderabbitai bot commented Feb 10, 2026

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

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

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

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 4bb41e2 and 23c556b.

📒 Files selected for processing (6)
  • pkg/cmd/openshift-apiserver/openshiftapiserver/openshift_apiserver.go
  • pkg/route/apiserver/apiserver.go
  • pkg/route/apiserver/registry/route/etcd/etcd.go
  • pkg/route/apiserver/registry/route/etcd/etcd_test.go
  • pkg/route/apiserver/registry/route/strategy.go
  • pkg/route/apiserver/registry/route/strategy_test.go
💤 Files with no reviewable changes (1)
  • pkg/route/apiserver/apiserver.go
🚧 Files skipped from review as they are similar to previous changes (1)
  • pkg/cmd/openshift-apiserver/openshiftapiserver/openshift_apiserver.go

Walkthrough

Removed feature-gate handling and config fields for Route External Certificates; route strategy and storage signatures were simplified and validation now unconditionally allows external certificates.

Changes

Cohort / File(s) Summary
Feature gate init change
pkg/cmd/openshift-apiserver/cmd.go
Stop passing the Route External Certificate feature gate into feature-gate initialization (now only openshiftfeatures.SelfManaged is passed).
Config cleanup
pkg/cmd/openshift-apiserver/openshiftapiserver/config.go
Removed feature-gate import and the evaluation/assignment of AllowRouteExternalCertificates.
Openshift API server config
pkg/cmd/openshift-apiserver/openshiftapiserver/openshift_apiserver.go
Removed AllowRouteExternalCertificates from OpenshiftAPIExtraConfig; no longer transfers that value into route server config.
Route apiserver surface
pkg/route/apiserver/apiserver.go
Removed AllowExternalCertificates field from ExtraConfig and dropped the boolean argument when constructing route REST storage.
Route etcd storage
pkg/route/apiserver/registry/route/etcd/etcd.go, pkg/route/apiserver/registry/route/etcd/etcd_test.go
Removed allowExternalCertificates parameter from NewREST; updated internal calls and tests to match the new signature.
Route strategy (behavior/API)
pkg/route/apiserver/registry/route/strategy.go, pkg/route/apiserver/registry/route/strategy_test.go
Removed per-instance allowExternalCertificates from routeStrategy and NewStrategy signature; route validation now sets AllowExternalCertificates: true unconditionally; removed tests and branches related to external-cert removal.

Sequence Diagram(s)

sequenceDiagram
    participant Client
    participant OpenshiftAPIServer
    participant RouteAPIServer
    participant Strategy
    participant Etcd

    Client->>OpenshiftAPIServer: Create Route (with ExternalCertificate)
    OpenshiftAPIServer->>RouteAPIServer: forward request
    RouteAPIServer->>Strategy: validate/prepare Route
    Strategy-->>RouteAPIServer: validation passes (ExternalCertificate preserved)
    RouteAPIServer->>Etcd: persist Route
    Etcd-->>RouteAPIServer: stored
    RouteAPIServer-->>Client: respond Created
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: removing the RouteExternalCertificate feature gate and hardcoding its value to true across multiple files and configuration layers.
Stable And Deterministic Test Names ✅ Passed All test names in modified test files are stable and deterministic with no dynamic content.
Test Structure And Quality ✅ Passed Test code adheres to quality requirements with single responsibilities, proper cleanup via defer statements, meaningful assertion messages, and comprehensive coverage without cluster interactions or timeout concerns.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

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 and usage tips.

RouteExternalCertificate is now enabled by default. This update is
removing references to this feature gate, hardcoding its value to true.
This update is also a pre-requisite to remove it from
openshift/cluster-ingress-operator.
@melvinjoseph86
Copy link

Marking this PR as verified as this openshift/cluster-ingress-operator#1355 (comment)
/verified by @mjoseph

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Feb 10, 2026
@openshift-ci-robot
Copy link

@melvinjoseph86: This PR has been marked as verified by @mjoseph.

Details

In response to this:

Marking this PR as verified as this openshift/cluster-ingress-operator#1355 (comment)
/verified by @mjoseph

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.

@jcmoraisjr
Copy link
Member Author

/retest

@rikatz
Copy link
Member

rikatz commented Feb 25, 2026

/assign
/cc

@openshift-ci openshift-ci bot requested a review from rikatz February 25, 2026 15:49
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Mar 2, 2026
@openshift-ci-robot
Copy link

@jcmoraisjr: This pull request references Jira Issue OCPBUGS-74511, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.22.0) matches configured target version for branch (4.22.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @melvinjoseph86

Details

In response to this:

RouteExternalCertificate is now enabled by default. This update is removing references to this feature gate, hardcoding its value to true. This update is also a pre-requisite to remove it from openshift/cluster-ingress-operator.

Summary by CodeRabbit

  • Refactor

  • External certificate support for routes is now always enabled, removing the previous feature gate configuration option.

  • Tests

  • Updated and removed tests related to feature gate configuration.

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (1)
pkg/route/apiserver/registry/route/strategy_test.go (1)

964-993: Consider whether these test cases are still meaningful.

The test cases "certificate-changed-to-external-certificate-denied-and-featuregate-is-not-set" and "certificate-changed-to-external-certificate-allowed-but-featuregate-is-not-set" set opts.AllowExternalCertificates: false, but since NewStrategy now hardcodes AllowExternalCertificates: true in routeValidationOptions(), these test cases may no longer exercise the intended code path.

If the goal is to test behavior when external certificates are disallowed, note that the strategy will always allow them now. These tests might be retained for historical documentation or to ensure the underlying validation logic still handles the false case, but they won't reflect actual runtime behavior.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@pkg/route/apiserver/registry/route/strategy_test.go` around lines 964 - 993,
The two test cases (names:
"certificate-changed-to-external-certificate-denied-and-featuregate-is-not-set"
and
"certificate-changed-to-external-certificate-allowed-but-featuregate-is-not-set")
are no longer exercising a disallowed-external-certificate path because
NewStrategy() hardcodes AllowExternalCertificates: true inside
routeValidationOptions(); update the tests to reflect runtime behavior by either
(A) setting opts.AllowExternalCertificates to true so the test asserts the
actual strategy behavior, or (B) remove/mark these cases as historical and
instead add a focused unit test that calls the underlying validation function
(route.ValidateRoute or whatever function performs TLS validation) directly with
AllowExternalCertificates=false to verify legacy validation logic; refer to
NewStrategy, routeValidationOptions, and the two test case names when making the
change.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@pkg/route/apiserver/registry/route/strategy_test.go`:
- Around line 964-993: The two test cases (names:
"certificate-changed-to-external-certificate-denied-and-featuregate-is-not-set"
and
"certificate-changed-to-external-certificate-allowed-but-featuregate-is-not-set")
are no longer exercising a disallowed-external-certificate path because
NewStrategy() hardcodes AllowExternalCertificates: true inside
routeValidationOptions(); update the tests to reflect runtime behavior by either
(A) setting opts.AllowExternalCertificates to true so the test asserts the
actual strategy behavior, or (B) remove/mark these cases as historical and
instead add a focused unit test that calls the underlying validation function
(route.ValidateRoute or whatever function performs TLS validation) directly with
AllowExternalCertificates=false to verify legacy validation logic; refer to
NewStrategy, routeValidationOptions, and the two test case names when making the
change.

ℹ️ Review info

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

Review profile: CHILL

Plan: Pro

Cache: Disabled due to data retention organization setting

Knowledge base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between 413f82a and ae7242d.

📒 Files selected for processing (6)
  • pkg/cmd/openshift-apiserver/openshiftapiserver/openshift_apiserver.go
  • pkg/route/apiserver/apiserver.go
  • pkg/route/apiserver/registry/route/etcd/etcd.go
  • pkg/route/apiserver/registry/route/etcd/etcd_test.go
  • pkg/route/apiserver/registry/route/strategy.go
  • pkg/route/apiserver/registry/route/strategy_test.go
💤 Files with no reviewable changes (1)
  • pkg/route/apiserver/apiserver.go

@jcmoraisjr jcmoraisjr force-pushed the OCPBUGS-74511-remove-featuregate branch from ae7242d to 4bb41e2 Compare March 2, 2026 13:23
AllowExternalCertificates is always true. This is removing all fields,
attributes and a unit test specific for this flag.
@jcmoraisjr jcmoraisjr force-pushed the OCPBUGS-74511-remove-featuregate branch from 4bb41e2 to 23c556b Compare March 2, 2026 13:27
@jcmoraisjr
Copy link
Member Author

/retest

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

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

@rikatz
Copy link
Member

rikatz commented Mar 2, 2026

/lgtm
/approve

Thanks!

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 2, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 2, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

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

@rikatz
Copy link
Member

rikatz commented Mar 2, 2026

@melvinjoseph86
Copy link

re-applying verified label based on #604 (comment)
will check this again with all other PRs of https://issues.redhat.com//browse/OCPBUGS-74511
/verified by @mjoseph

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 4, 2026
@openshift-ci-robot
Copy link

@melvinjoseph86: This PR has been marked as verified by @mjoseph.

Details

In response to this:

re-applying verified label based on #604 (comment)
will check this again with all other PRs of https://issues.redhat.com//browse/OCPBUGS-74511
/verified by @mjoseph

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.

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

Labels

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.

5 participants