USHIFT-6947: C2CC: Configurable routing table IDs#6875
Conversation
|
@pmtk: This pull request references USHIFT-6947 which is a valid jira issue. Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "5.0.0" version, but no target version was set. 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. |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository YAML (base), Central YAML (inherited) Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (3)
WalkthroughAdds configurable ChangesC2CC Configurable Routing Table IDs
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Suggested reviewers
🚥 Pre-merge checks | ✅ 13 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (13 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.2)level=warning msg="The linter 'gomodguard' is deprecated (since v2.12.0) due to: new major version. Replaced by gomodguard_v2." ... [truncated 31032 characters] ... elet: is replaced in go.mod, but not marked as replaced in vendor/modules.txt\n\tk8s.io/metrics: is replaced in go.mod, but not marked as replaced in vendor/modules.txt\n\tk8s.io/mount-utils: is replaced in go.mod, but not marked as replaced in vendor/modules.txt\n\tk8s.io/pod-security-admission: is replaced in go.mod, but not marked as replaced in vendor/modules.txt\n\tk8s.io/sample-apiserver: is replaced in go.mod, but not marked as replaced in vendor/modules.txt\n\tk8s.io/sample-cli-plugin: is replaced in go.mod, but not marked as replaced in vendor/modules.txt\n\tk8s.io/sample-controller: is replaced in go.mod, but not marked as replaced in vendor/modules.txt\n\n\tTo ignore the vendor directory, use -mod=readonly or -mod=mod.\n\tTo sync the vendor directory, run:\n\t\tgo mod vendor\n" Comment |
|
Skipping CI for Draft Pull Request. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pmtk 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 |
There was a problem hiding this comment.
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 `@docs/user/howto_config.md`:
- Around line 43-45: The routing configuration example in the config format
block uses invalid values for routeTableID and serviceRouteTableID (both set to
0), which violates the runtime contract requiring IDs to be in the range 1..252
and requiring both IDs to differ. Either replace these values with valid
examples (such as routeTableID: 1 and serviceRouteTableID: 2) that satisfy the
constraints, or remove these fields from the documentation example to avoid
misleading users into creating invalid configurations.
In `@pkg/config/c2cc_test.go`:
- Around line 95-96: The mk*C2CCConfig builders are applying
withRoutingDefaults() wrapper in addition to withDNSDefaults(), which masks the
nil-routing default path and prevents proper coverage testing. Remove the
withRoutingDefaults() wrapper from all three mk*C2CCConfig builder methods at
their respective locations (keeping only withDNSDefaults()), so that tests
specifically designed to exercise nil routing input (such as the "defaults are
used when nil" test case) can properly verify the resolveRoutingDefaults()
behavior without having defaults pre-applied by the fixture builders.
In `@pkg/config/config.go`:
- Around line 588-589: The issue is that c.C2CC.resolveRoutingDefaults() is
called unconditionally at line 588, but the validation of routing table IDs only
occurs when C2CC is enabled within the Config.validate() method. This allows
invalid user-supplied routing IDs to reach runtime when C2CC is disabled. To fix
this, ensure that the c.C2CC.validate(c) call in the validate() method runs
unconditionally regardless of whether C2CC is enabled, so that routing table ID
validation happens at the trust boundary before any runtime consumption.
Validate user-configured routing IDs using an allow-list approach before they
are consumed by the disabled-mode cleanup route managers.
🪄 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: Enterprise
Run ID: 8e829281-1343-4e22-8cd3-3a827614ee8a
📒 Files selected for processing (10)
cmd/generate-config/config/config-openapi-spec.jsondocs/user/howto_config.mdpackaging/microshift/config.yamlpkg/config/c2cc.gopkg/config/c2cc_test.gopkg/config/config.gopkg/controllers/c2cc/controller.gopkg/controllers/c2cc/helpers_test.gopkg/controllers/c2cc/routes.gopkg/controllers/c2cc/service_routes.go
|
/test ? |
90ebcaa to
8db17da
Compare
|
/retest |
1 similar comment
|
/retest |
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 `@test/suites/c2cc/custom-route-tables.robot`:
- Around line 116-124: The rule deletion command on line 123 uses only the
priority value to delete rules, which can inadvertently remove unrelated rules
that share the same priority, including default C2CC rules. Instead of deleting
by priority alone using just prio, extract and use the full rule selector from
the original line variable that includes the lookup criteria for the custom
route tables. This way, the deletion command will match and remove only the
exact rules intended rather than any rule with that priority value.
🪄 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: Enterprise
Run ID: 09744e16-a99b-4f7f-8be4-b63427ad8d51
📒 Files selected for processing (3)
test/resources/c2cc.resourcetest/suites/c2cc/cleanup.robottest/suites/c2cc/custom-route-tables.robot
💤 Files with no reviewable changes (1)
- test/suites/c2cc/cleanup.robot
dc1e877 to
5801205
Compare
Co-authored-by: Alejandro Gullón <agullon@redhat.com>
|
@pmtk: The following tests failed, say
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. |
Summary by CodeRabbit
clusterToCluster.routingfor C2CC Linux policy routing table IDs (routeTableID,serviceRouteTableID) with sensible defaults.config.yamland the configuration guide with the new routing block and example values.