fix bug - #3120
Conversation
|
Warning Review limit reached
Next review available in: 40 minutes You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe change gates controller and policy-engine ChangesAdmin endpoint controls
Router admin runtime
Deployment and documentation wiring
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant RuntimeEntrypoint
participant Envoy
participant RouterHealthCheck
RuntimeEntrypoint->>Envoy: Inject admin listener when ROUTER_ADMIN_ENABLED=true
RuntimeEntrypoint->>Envoy: Omit admin listener when disabled
RouterHealthCheck->>Envoy: GET /ready when admin is enabled
RouterHealthCheck->>Envoy: TCP check on ROUTER_HTTP_PORT when admin is disabled
Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 2 | ❌ 3❌ Failed checks (2 warnings, 1 inconclusive)
✅ Passed checks (2 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 |
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (1)
gateway/gateway-runtime/policy-engine/internal/admin/server_test.go (1)
79-79: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick winAdd disabled-state coverage for
/config_dump.The changed test verifies only the enabled route. Add a separate test that leaves
ConfigDump.Enabledfalse and asserts that/config_dumpreturns HTTP 404. This protects the fail-closed default.🤖 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 `@gateway/gateway-runtime/policy-engine/internal/admin/server_test.go` at line 79, Add a separate test function that verifies the disabled-state behavior of the /config_dump endpoint. In this new test, set ConfigDump.Enabled to false in the configuration, then make a request to /config_dump and assert that it returns HTTP 404. This ensures the endpoint properly enforces the fail-closed default when the feature is disabled.
🤖 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 `@gateway/gateway-runtime/docker-entrypoint.sh`:
- Around line 184-193: Enforce loopback-only Router admin binding before
generating the admin configuration in the ROUTER_ADMIN_ENABLED branch of
gateway/gateway-runtime/docker-entrypoint.sh and the corresponding branch at
gateway/gateway-runtime/docker-entrypoint-debug.sh; reject non-loopback
ROUTER_ADMIN_HOST values. Update the debug entrypoint’s loopback documentation
to match the enforced behavior. In kubernetes/helm/gateway-helm-chart/README.md,
do not describe the admin interface as loopback-only unless both entrypoints
enforce that boundary.
In `@gateway/gateway-runtime/health-check.sh`:
- Around line 32-46: Remove the HTTP listener TCP fallback from the
ROUTER_ADMIN_ENABLED=false branch of health-check.sh, since it cannot establish
Envoy readiness. Use a genuine Envoy readiness check instead, or separate the
probe behavior so TCP is used only for liveness and readiness validates loaded
routes, clusters, listeners, and ext_proc configuration.
In
`@kubernetes/gateway-operator/internal/controller/resources/api-platform-gateway-k8s-manifests.yaml`:
- Around line 37-40: Update the Deployment readiness and liveness probes near
the existing port 9901 `/ready` checks to target a listener that is enabled and
reachable, such as the runtime health endpoint or a TCP probe on the HTTP
listener. Do not rely on the disabled or loopback-only Envoy admin listener
unless the Deployment explicitly enables and locally exposes it.
---
Nitpick comments:
In `@gateway/gateway-runtime/policy-engine/internal/admin/server_test.go`:
- Line 79: Add a separate test function that verifies the disabled-state
behavior of the /config_dump endpoint. In this new test, set ConfigDump.Enabled
to false in the configuration, then make a request to /config_dump and assert
that it returns HTTP 404. This ensures the endpoint properly enforces the
fail-closed default when the feature is disabled.
🪄 Autofix
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 34116d44-b762-4c78-be7c-afb6645f9a24
📒 Files selected for processing (29)
gateway/configs/config-template.tomlgateway/configs/config.tomlgateway/distribution/docker-compose.yamlgateway/docker-compose-perf.yamlgateway/docker-compose.debug.yamlgateway/docker-compose.yamlgateway/gateway-controller/pkg/adminserver/server.gogateway/gateway-controller/pkg/adminserver/server_test.gogateway/gateway-controller/pkg/config/config.gogateway/gateway-runtime/docker-entrypoint-debug.shgateway/gateway-runtime/docker-entrypoint.shgateway/gateway-runtime/health-check.shgateway/gateway-runtime/policy-engine/internal/admin/server.gogateway/gateway-runtime/policy-engine/internal/admin/server_test.gogateway/gateway-runtime/policy-engine/internal/config/config.gogateway/gateway-runtime/router/config/envoy-bootstrap.yamlgateway/it/docker-compose.test.postgres.yamlgateway/it/docker-compose.test.sqlserver.yamlgateway/it/docker-compose.test.vhosts-multi.yamlgateway/it/docker-compose.test.vhosts-single.yamlgateway/it/docker-compose.test.yamlgateway/it/test-config.tomlgateway/it/test-config.vhosts-multi.tomlgateway/it/test-config.vhosts-single.tomlkubernetes/gateway-operator/internal/controller/resources/api-platform-gateway-k8s-manifests.yamlkubernetes/helm/gateway-helm-chart/README.mdkubernetes/helm/gateway-helm-chart/templates/gateway/gateway-config.yamlkubernetes/helm/gateway-helm-chart/templates/gateway/gateway-runtime/deployment.yamlkubernetes/helm/gateway-helm-chart/values.yaml
067f59f to
6f36a61
Compare
6f36a61 to
a92b9d5
Compare
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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 @.claude/rules/go-control-plane-xds-security.md:
- Around line 64-67: Update the shell example comments to use Bash-style #
syntax instead of //. Change the ROUTER_ADMIN_HOST handling so it validates the
value is loopback-only or sets it explicitly to 127.0.0.1, ensuring the injected
admin interface cannot bind to a non-loopback address.
In `@gateway/it/docker-compose.test.vhosts-single.yaml`:
- Around line 78-81: Enforce loopback-only binding for ROUTER_ADMIN_HOST: update
gateway/it/docker-compose.test.vhosts-single.yaml lines 78-81 to stop
configuring 0.0.0.0 while preserving host-side readiness access, and update
.claude/rules/go-control-plane-xds-security.md lines 68-74 to document or
require validation that rejects non-loopback admin hosts.
🪄 Autofix
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: acc29c53-5c2d-4ebe-a819-95c09487f5c2
📒 Files selected for processing (9)
.claude/rules/go-control-plane-xds-security.mdgateway/gateway-runtime/policy-engine/configs/envoy-backup.yamlgateway/gateway-runtime/policy-engine/configs/envoy.yamlgateway/it/docker-compose.test.postgres.yamlgateway/it/docker-compose.test.sqlserver.yamlgateway/it/docker-compose.test.vhosts-multi.yamlgateway/it/docker-compose.test.vhosts-single.yamlgateway/it/docker-compose.test.yamlkubernetes/gateway-operator/internal/controller/resources/api-platform-gateway-k8s-manifests.yaml
🚧 Files skipped from review as they are similar to previous changes (4)
- gateway/it/docker-compose.test.yaml
- gateway/it/docker-compose.test.postgres.yaml
- gateway/it/docker-compose.test.sqlserver.yaml
- gateway/it/docker-compose.test.vhosts-multi.yaml
a92b9d5 to
f908ead
Compare
f908ead to
cbc5570
Compare
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 @.claude/rules/go-control-plane-xds-security.md:
- Around line 69-73: Update the ROUTER_ADMIN_HOST validation case to accept only
the literal 127.0.0.1 address, rejecting ::1, localhost, and all other values
while preserving the existing fatal error behavior.
🪄 Autofix
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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 12e1d3bf-2a00-420d-a402-dfd6b82a08f9
📒 Files selected for processing (2)
.claude/rules/go-control-plane-xds-security.mdgateway/configs/config.toml
cbc5570 to
9b84899
Compare
9b84899 to
7f39ea0
Compare
fix bug