Skip to content

API: replace bridge autoCreate with a lifecycle enum - #626

Merged
maiqueb merged 5 commits into
openperouter:mainfrom
qinqon:api-bridge-lifecycle
Jul 30, 2026
Merged

maiqueb merged 5 commits into
openperouter:mainfrom
qinqon:api-bridge-lifecycle

Conversation

@qinqon

@qinqon qinqon commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

Is this a BUG FIX or a FEATURE ?:

/kind feature

What this PR does / why we need it:

Implements part of the Replace Boolean Fields
section of the API improvements enhancement: autoCreate on
LinuxBridgeConfig and OVSBridgeConfig is replaced by a lifecycle
enum.

The enum carries exactly the two meanings the boolean already had:

before after
autoCreate: true lifecycle: Managed — controller creates and owns the bridge, named br-hs-<VNI>, and deletes it with the L2VNI
name: <bridge> lifecycle: External + name: <bridge> — user provides a pre-existing bridge, never created or deleted by the controller
# before
hostmaster:
  type: linux-bridge
  linuxBridge:
    autoCreate: true

# after
hostmaster:
  type: linux-bridge
  linuxBridge:
    lifecycle: Managed

The mutual exclusivity is preserved, just expressed on the enum:

before:  (name != "") != autoCreate
after:   (name != "") != (lifecycle == 'Managed')

Special notes for your reviewer:
N/S

Release note:

The `autoCreate` field on `L2VNI` `hostmaster.linuxBridge` and `hostmaster.ovsBridge` has been replaced by a `lifecycle` enum. Replace `autoCreate: true` with `lifecycle: Managed`, and a bare `name: <bridge>` with `lifecycle: External` plus `name: <bridge>`. As before, a name may only be set for user provided (External) bridges; Managed bridges are named `br-hs-<VNI>`.

AI Guidelines Acknowledgment:

  • I have reviewed all changes in this PR, including any AI-generated content, and I take full responsibility for its accuracy and correctness.

Summary by CodeRabbit

Summary

  • New Features
    • Added a bridge lifecycle option (Managed or External) for both Linux and OVS bridges.
  • Breaking Changes
    • Replaced autoCreate with required lifecycle.
    • Validation changed: External requires name; Managed forbids name.
  • Bug Fixes
    • Improved config handling and bridge lifecycle behavior to follow the new rules.
  • Documentation / Examples / Tests
    • Updated API reference, CRD schemas/manifests, user-facing docs, and e2e/config validation coverage to use lifecycle.

@coderabbitai

coderabbitai Bot commented Jul 28, 2026

Copy link
Copy Markdown

Review Change Stack

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
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 4b91cc62-f2e8-4813-92aa-c69220290f22

📥 Commits

Reviewing files that changed from the base of the PR and between 5d6e730 and 0fd79a3.

📒 Files selected for processing (47)
  • API-DOCS.md
  • api/v1alpha1/l2vni_types.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • charts/openperouter/charts/crds/templates/network.openperouter.io_l2vnis.yaml
  • config/all-in-one/crio.yaml
  • config/all-in-one/openpe.yaml
  • config/crd/bases/network.openperouter.io_l2vnis.yaml
  • config/samples/l2vni-nodeselector-at-workers.yaml
  • config/samples/l2vni-nodeselector-different-racks.yaml
  • config/samples/l2vni-ovs.yaml
  • config/samples/l2vni.yaml
  • e2etests/scale_tests/scale.go
  • e2etests/tests/bridgerefresh.go
  • e2etests/tests/evpn_l2.go
  • e2etests/tests/frr_restart.go
  • e2etests/tests/ipv6_vtep.go
  • e2etests/tests/l3vpn_l2.go
  • e2etests/tests/resiliency.go
  • e2etests/tests/singlesession.go
  • e2etests/tests/systemd_resiliency.go
  • e2etests/tests/underlay_address_families.go
  • examples/evpn/cni-underlay/openpe.yaml
  • examples/evpn/kubevirt/openpe.yaml
  • examples/evpn/layer2/openpe.yaml
  • examples/evpn/multi-cluster/cluster-a-migration-l2vni.yaml
  • examples/evpn/multi-cluster/cluster-a-openpe.yaml
  • examples/evpn/multi-cluster/cluster-b-migration-l2vni.yaml
  • examples/evpn/multi-cluster/cluster-b-openpe.yaml
  • examples/l3vpn/layer2/openpe.yaml
  • internal/controller/routerconfiguration/static_configuration_reader_test.go
  • internal/conversion/host_conversion.go
  • internal/conversion/host_conversion_test.go
  • internal/conversion/validate_vni_test.go
  • internal/crdschema/crdschema_test.go
  • internal/crdschema/parity_test.go
  • internal/staticconfiguration/reader_test.go
  • internal/staticconfiguration/testdata/openpe_l2vni.yaml
  • internal/staticconfiguration/testdata/openpe_l3vpn.yaml
  • operator/bundle/manifests/network.openperouter.io_l2vnis.yaml
  • website/content/docs/api-reference.md
  • website/content/docs/configuration/evpn.md
  • website/content/docs/configuration/node-selector.md
  • website/content/docs/configuration/srv6.md
  • website/content/docs/examples/evpnexamples/kubevirt-multi-cluster.md
  • website/content/docs/examples/evpnexamples/kubevirt.md
  • website/content/docs/examples/evpnexamples/layer2.md
  • website/content/docs/examples/srv6examples/layer2.md
💤 Files with no reviewable changes (1)
  • api/v1alpha1/zz_generated.deepcopy.go
🚧 Files skipped from review as they are similar to previous changes (38)
  • examples/evpn/multi-cluster/cluster-b-migration-l2vni.yaml
  • config/samples/l2vni-nodeselector-at-workers.yaml
  • config/samples/l2vni-nodeselector-different-racks.yaml
  • config/samples/l2vni.yaml
  • website/content/docs/examples/evpnexamples/layer2.md
  • internal/staticconfiguration/testdata/openpe_l2vni.yaml
  • website/content/docs/examples/evpnexamples/kubevirt-multi-cluster.md
  • examples/evpn/layer2/openpe.yaml
  • examples/evpn/multi-cluster/cluster-a-openpe.yaml
  • examples/evpn/multi-cluster/cluster-b-openpe.yaml
  • examples/evpn/cni-underlay/openpe.yaml
  • examples/evpn/kubevirt/openpe.yaml
  • config/all-in-one/openpe.yaml
  • e2etests/tests/frr_restart.go
  • examples/l3vpn/layer2/openpe.yaml
  • operator/bundle/manifests/network.openperouter.io_l2vnis.yaml
  • e2etests/tests/underlay_address_families.go
  • config/crd/bases/network.openperouter.io_l2vnis.yaml
  • e2etests/tests/bridgerefresh.go
  • website/content/docs/configuration/srv6.md
  • API-DOCS.md
  • e2etests/tests/systemd_resiliency.go
  • internal/conversion/host_conversion.go
  • website/content/docs/api-reference.md
  • internal/conversion/host_conversion_test.go
  • e2etests/tests/resiliency.go
  • config/all-in-one/crio.yaml
  • website/content/docs/configuration/node-selector.md
  • e2etests/scale_tests/scale.go
  • internal/staticconfiguration/reader_test.go
  • website/content/docs/examples/evpnexamples/kubevirt.md
  • api/v1alpha1/l2vni_types.go
  • internal/conversion/validate_vni_test.go
  • website/content/docs/examples/srv6examples/layer2.md
  • internal/crdschema/parity_test.go
  • internal/controller/routerconfiguration/static_configuration_reader_test.go
  • e2etests/tests/evpn_l2.go
  • internal/crdschema/crdschema_test.go

📝 Walkthrough

Walkthrough

Bridge configuration now uses a required Lifecycle enum with Managed and External values instead of AutoCreate. CRD validation, conversion, tests, samples, examples, and documentation enforce lifecycle-dependent bridge naming.

Changes

Bridge lifecycle configuration

Layer / File(s) Summary
API lifecycle contract
api/v1alpha1/l2vni_types.go, api/v1alpha1/zz_generated.deepcopy.go, API-DOCS.md, website/content/docs/api-reference.md
Adds BridgeLifecycle, replaces bridge AutoCreate fields with required Lifecycle, and validates conditional Name usage.
CRD lifecycle validation
charts/.../network.openperouter.io_l2vnis.yaml, config/.../network.openperouter.io_l2vnis.yaml, operator/bundle/manifests/...
Updates Linux and OVS bridge schemas with required lifecycle fields and lifecycle-dependent CEL validation.
Conversion and schema validation
internal/conversion/*, internal/crdschema/*, internal/controller/routerconfiguration/*, internal/staticconfiguration/*
Updates conversion, fixtures, defaults, validation, round trips, and error assertions for lifecycle semantics.
Configuration and end-to-end migration
config/samples/*, examples/*, e2etests/*
Replaces bridge autoCreate settings with Managed or External lifecycle values across samples and test scenarios.
Documentation updates
website/content/docs/configuration/*, website/content/docs/examples/*
Documents lifecycle values, conditional bridge names, reconciliation behavior, and updated examples.

Estimated code review effort: 3 (Moderate) | ~25 minutes

Possibly related PRs

Suggested reviewers: ramlavi, maiqueb, andreaskaris

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% 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
Title check ✅ Passed Clear, concise, and accurately summarizes the main API change.
Description check ✅ Passed Matches the template with all required sections filled, including kind, summary, special notes, release note, and acknowledgment.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Caution

The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased.

@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 `@api/v1alpha1/l2vni_types.go`:
- Around line 149-165: Preserve a transitional autoCreate-compatible
representation and conversion for existing managed L2VNI resources in
api/v1alpha1/l2vni_types.go, accepting empty Lifecycle with no Name as the
legacy managed form and converting it to the correct managed behavior. Update
the CRD schemas in
charts/openperouter/charts/crds/templates/network.openperouter.io_l2vnis.yaml
(71-120), config/all-in-one/crio.yaml (80-129), config/all-in-one/openpe.yaml
(80-129), config/crd/bases/network.openperouter.io_l2vnis.yaml (71-120), and
operator/bundle/manifests/network.openperouter.io_l2vnis.yaml (71-120) to accept
the legacy autoCreate shape during migration; do not make lifecycle required
until existing objects have been migrated.

In `@internal/conversion/host_conversion_test.go`:
- Line 475: Update the HostMaster fixture in the relevant conversion test to set
LinuxBridge.Lifecycle explicitly to BridgeLifecycleExternal, ensuring it
verifies the External-to-AutoCreate=false conversion; add a separate Managed
fixture/assertion that verifies the mapping to AutoCreate=true.

In `@website/content/docs/configuration/srv6.md`:
- Line 252: Replace the remaining explanatory references to
hostmaster.autocreate with documentation for lifecycle: Managed in
website/content/docs/configuration/srv6.md lines 252-252,
website/content/docs/examples/evpnexamples/kubevirt-multi-cluster.md lines
82-82, website/content/docs/examples/evpnexamples/kubevirt.md lines 78-78,
website/content/docs/examples/evpnexamples/layer2.md lines 72-72, and
website/content/docs/examples/srv6examples/layer2.md lines 89-89; update each
adjacent note or configuration entry while preserving the existing YAML
examples.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 16eb1d7e-d798-4e34-a4cf-1062e34d3d77

📥 Commits

Reviewing files that changed from the base of the PR and between a4bb871 and 919b565.

📒 Files selected for processing (47)
  • API-DOCS.md
  • api/v1alpha1/l2vni_types.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • charts/openperouter/charts/crds/templates/network.openperouter.io_l2vnis.yaml
  • config/all-in-one/crio.yaml
  • config/all-in-one/openpe.yaml
  • config/crd/bases/network.openperouter.io_l2vnis.yaml
  • config/samples/l2vni-nodeselector-at-workers.yaml
  • config/samples/l2vni-nodeselector-different-racks.yaml
  • config/samples/l2vni-ovs.yaml
  • config/samples/l2vni.yaml
  • e2etests/scale_tests/scale.go
  • e2etests/tests/bridgerefresh.go
  • e2etests/tests/evpn_l2.go
  • e2etests/tests/frr_restart.go
  • e2etests/tests/ipv6_vtep.go
  • e2etests/tests/l3vpn_l2.go
  • e2etests/tests/resiliency.go
  • e2etests/tests/singlesession.go
  • e2etests/tests/systemd_resiliency.go
  • e2etests/tests/underlay_address_families.go
  • examples/evpn/cni-underlay/openpe.yaml
  • examples/evpn/kubevirt/openpe.yaml
  • examples/evpn/layer2/openpe.yaml
  • examples/evpn/multi-cluster/cluster-a-migration-l2vni.yaml
  • examples/evpn/multi-cluster/cluster-a-openpe.yaml
  • examples/evpn/multi-cluster/cluster-b-migration-l2vni.yaml
  • examples/evpn/multi-cluster/cluster-b-openpe.yaml
  • examples/l3vpn/layer2/openpe.yaml
  • internal/controller/routerconfiguration/static_configuration_reader_test.go
  • internal/conversion/host_conversion.go
  • internal/conversion/host_conversion_test.go
  • internal/conversion/validate_vni_test.go
  • internal/crdschema/crdschema_test.go
  • internal/crdschema/parity_test.go
  • internal/staticconfiguration/reader_test.go
  • internal/staticconfiguration/testdata/openpe_l2vni.yaml
  • internal/staticconfiguration/testdata/openpe_l3vpn.yaml
  • operator/bundle/manifests/network.openperouter.io_l2vnis.yaml
  • website/content/docs/api-reference.md
  • website/content/docs/configuration/evpn.md
  • website/content/docs/configuration/node-selector.md
  • website/content/docs/configuration/srv6.md
  • website/content/docs/examples/evpnexamples/kubevirt-multi-cluster.md
  • website/content/docs/examples/evpnexamples/kubevirt.md
  • website/content/docs/examples/evpnexamples/layer2.md
  • website/content/docs/examples/srv6examples/layer2.md
💤 Files with no reviewable changes (1)
  • api/v1alpha1/zz_generated.deepcopy.go

Comment thread api/v1alpha1/l2vni_types.go
},
L2GatewayIPs: []string{"192.168.100.1/24"},
HostMaster: &hostnetwork.HostMaster{Name: new("br0"), Type: "linux-bridge"},
HostMaster: &hostnetwork.HostMaster{Name: new("br0"), Type: "linux-bridge", AutoCreate: new(false)},

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use an explicit External lifecycle in this fixture.

The input fixture sets a bridge name but omits required Lifecycle, so this expectation validates the zero-value fallback rather than the External-to-AutoCreate=false conversion. Set LinuxBridge.Lifecycle to BridgeLifecycleExternal in the fixture; add a Managed case separately to cover the true mapping.

🤖 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 `@internal/conversion/host_conversion_test.go` at line 475, Update the
HostMaster fixture in the relevant conversion test to set LinuxBridge.Lifecycle
explicitly to BridgeLifecycleExternal, ensuring it verifies the
External-to-AutoCreate=false conversion; add a separate Managed
fixture/assertion that verifies the mapping to AutoCreate=true.

Comment thread website/content/docs/configuration/srv6.md
@qinqon
qinqon force-pushed the api-bridge-lifecycle branch 2 times, most recently from b4aad33 to 9f2fbd3 Compare July 28, 2026 12:03

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

🧹 Nitpick comments (1)
website/content/docs/configuration/evpn.md (1)

201-203: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Document the External condition explicitly.

Replace “Managed or a name is set” with “Managed, or External with name set” so the documented behavior matches the lifecycle contract and does not imply that name presence alone selects the behavior.

🤖 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 `@website/content/docs/configuration/evpn.md` around lines 201 - 203, Update
the host-veth connection description in the documented lifecycle behavior to
state “Managed, or External with name set,” replacing the current “Managed or a
name is set” wording while leaving the surrounding bridge behavior unchanged.
🤖 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 `@website/content/docs/configuration/evpn.md`:
- Around line 167-170: Update the bridge configuration table entries for
hostmaster.linuxBridge.lifecycle and hostmaster.ovsBridge.lifecycle to state
that the lifecycle for the bridge selected by hostmaster.type is required,
rather than marking both fields unconditionally required. Clarify the
corresponding name-row requiredness and replace the duplicated “Only” wording
with concise conditional text.

---

Nitpick comments:
In `@website/content/docs/configuration/evpn.md`:
- Around line 201-203: Update the host-veth connection description in the
documented lifecycle behavior to state “Managed, or External with name set,”
replacing the current “Managed or a name is set” wording while leaving the
surrounding bridge behavior unchanged.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: c53c8a5f-0324-47dc-ab8c-de8c8bc157c5

📥 Commits

Reviewing files that changed from the base of the PR and between 919b565 and 9f2fbd3.

📒 Files selected for processing (47)
  • API-DOCS.md
  • api/v1alpha1/l2vni_types.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • charts/openperouter/charts/crds/templates/network.openperouter.io_l2vnis.yaml
  • config/all-in-one/crio.yaml
  • config/all-in-one/openpe.yaml
  • config/crd/bases/network.openperouter.io_l2vnis.yaml
  • config/samples/l2vni-nodeselector-at-workers.yaml
  • config/samples/l2vni-nodeselector-different-racks.yaml
  • config/samples/l2vni-ovs.yaml
  • config/samples/l2vni.yaml
  • e2etests/scale_tests/scale.go
  • e2etests/tests/bridgerefresh.go
  • e2etests/tests/evpn_l2.go
  • e2etests/tests/frr_restart.go
  • e2etests/tests/ipv6_vtep.go
  • e2etests/tests/l3vpn_l2.go
  • e2etests/tests/resiliency.go
  • e2etests/tests/singlesession.go
  • e2etests/tests/systemd_resiliency.go
  • e2etests/tests/underlay_address_families.go
  • examples/evpn/cni-underlay/openpe.yaml
  • examples/evpn/kubevirt/openpe.yaml
  • examples/evpn/layer2/openpe.yaml
  • examples/evpn/multi-cluster/cluster-a-migration-l2vni.yaml
  • examples/evpn/multi-cluster/cluster-a-openpe.yaml
  • examples/evpn/multi-cluster/cluster-b-migration-l2vni.yaml
  • examples/evpn/multi-cluster/cluster-b-openpe.yaml
  • examples/l3vpn/layer2/openpe.yaml
  • internal/controller/routerconfiguration/static_configuration_reader_test.go
  • internal/conversion/host_conversion.go
  • internal/conversion/host_conversion_test.go
  • internal/conversion/validate_vni_test.go
  • internal/crdschema/crdschema_test.go
  • internal/crdschema/parity_test.go
  • internal/staticconfiguration/reader_test.go
  • internal/staticconfiguration/testdata/openpe_l2vni.yaml
  • internal/staticconfiguration/testdata/openpe_l3vpn.yaml
  • operator/bundle/manifests/network.openperouter.io_l2vnis.yaml
  • website/content/docs/api-reference.md
  • website/content/docs/configuration/evpn.md
  • website/content/docs/configuration/node-selector.md
  • website/content/docs/configuration/srv6.md
  • website/content/docs/examples/evpnexamples/kubevirt-multi-cluster.md
  • website/content/docs/examples/evpnexamples/kubevirt.md
  • website/content/docs/examples/evpnexamples/layer2.md
  • website/content/docs/examples/srv6examples/layer2.md
💤 Files with no reviewable changes (1)
  • api/v1alpha1/zz_generated.deepcopy.go
🚧 Files skipped from review as they are similar to previous changes (44)
  • examples/l3vpn/layer2/openpe.yaml
  • config/samples/l2vni-ovs.yaml
  • internal/staticconfiguration/testdata/openpe_l3vpn.yaml
  • config/samples/l2vni.yaml
  • internal/staticconfiguration/testdata/openpe_l2vni.yaml
  • examples/evpn/multi-cluster/cluster-a-migration-l2vni.yaml
  • config/samples/l2vni-nodeselector-different-racks.yaml
  • website/content/docs/configuration/srv6.md
  • examples/evpn/kubevirt/openpe.yaml
  • examples/evpn/multi-cluster/cluster-b-migration-l2vni.yaml
  • internal/conversion/host_conversion_test.go
  • examples/evpn/multi-cluster/cluster-b-openpe.yaml
  • examples/evpn/layer2/openpe.yaml
  • e2etests/tests/frr_restart.go
  • config/crd/bases/network.openperouter.io_l2vnis.yaml
  • website/content/docs/examples/srv6examples/layer2.md
  • internal/staticconfiguration/reader_test.go
  • internal/conversion/host_conversion.go
  • e2etests/tests/underlay_address_families.go
  • charts/openperouter/charts/crds/templates/network.openperouter.io_l2vnis.yaml
  • website/content/docs/configuration/node-selector.md
  • config/all-in-one/openpe.yaml
  • e2etests/tests/resiliency.go
  • e2etests/tests/singlesession.go
  • operator/bundle/manifests/network.openperouter.io_l2vnis.yaml
  • examples/evpn/cni-underlay/openpe.yaml
  • config/all-in-one/crio.yaml
  • website/content/docs/examples/evpnexamples/kubevirt.md
  • examples/evpn/multi-cluster/cluster-a-openpe.yaml
  • API-DOCS.md
  • website/content/docs/examples/evpnexamples/layer2.md
  • e2etests/tests/bridgerefresh.go
  • e2etests/tests/ipv6_vtep.go
  • internal/conversion/validate_vni_test.go
  • website/content/docs/api-reference.md
  • e2etests/tests/systemd_resiliency.go
  • website/content/docs/examples/evpnexamples/kubevirt-multi-cluster.md
  • config/samples/l2vni-nodeselector-at-workers.yaml
  • e2etests/tests/l3vpn_l2.go
  • e2etests/tests/evpn_l2.go
  • api/v1alpha1/l2vni_types.go
  • internal/crdschema/crdschema_test.go
  • internal/crdschema/parity_test.go
  • internal/controller/routerconfiguration/static_configuration_reader_test.go

Comment thread website/content/docs/configuration/evpn.md

@maiqueb maiqueb left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice.

type: linux-bridge
linuxBridge:
autoCreate: true
lifecycle: Managed

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

hostmaster.autocreate is still used 2 times on this md file: [0] [1]

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

hostmaster:
type: linux-bridge
linuxBridge:
autoCreate: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto. look for hostmaster.autocreate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

hostmaster:
type: linux-bridge
linuxBridge:
autoCreate: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto. look for hostmaster.autocreate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done

hostmaster:
type: linux-bridge
linuxBridge:
autoCreate: true

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

ditto. look for hostmaster.autocreate

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done


const (
// BridgeLifecycleManaged means the controller creates and owns the
// bridge, named br-hs-<VNI>, and deletes it when the L2VNI is removed.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

enhancement says:

    // BridgeLifecycleManaged means the controller creates and owns
    // the bridge, and deletes it when the L2VNI is removed. If Name is
    // omitted, the bridge is auto-named br-hs-<VNI>. If Name is
    // provided, the controller creates the bridge with that name.
    BridgeLifecycleManaged BridgeLifecycle = "Managed"

reading this one could understand that name + Managed should be a valid combination.

Howiever in this PR - the comment is droped entirely, and the CEL rule

((self.?name.orValue("") != "") != (self.?lifecycle.orValue("") == 'Managed')) 

actively forbids setting name when lifecycle: Managed is dropping the custom-named-Managed-bridge capability intentionally

So, I'm confused. Can you explain which is correct?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I guess it's a good point.

Which would we want to follow ? IMHO it can be either way - but, if we stick to the existing behavior, it should be an exclusive or. Not sure we want to do that.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

But it just means we need to have @fedepaol 's blessing.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@RamLavi originally I was implementing adding Name when managed, but I decided to keep current behaviour to reduce PR size, we can implement follow up PR to support Name + Managed as a new feature.

I want the PR to be just about the k8s API, in fact I keep the internal structures with the autoCreate boolean.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

IMHO, that makes sense. We can change the behavior later - but if we want that, we need to move rather soon.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

got it. fine by me.

@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: 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 `@API-DOCS.md`:
- Around line 581-582: Update the source descriptions for the Linux and OVS
bridge name fields to state that External bridges require a non-empty name,
while Managed bridges must omit name; then regenerate the artifacts. Apply the
generated description updates at API-DOCS.md lines 581-582 and 676-677,
website/content/docs/api-reference.md lines 589-590 and 684-685, and
config/all-in-one/crio.yaml lines 89-91 and 116-118.
🪄 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: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: b667b83c-08f6-485a-a7f0-bd8056fcf550

📥 Commits

Reviewing files that changed from the base of the PR and between 9f2fbd3 and d564e37.

📒 Files selected for processing (47)
  • API-DOCS.md
  • api/v1alpha1/l2vni_types.go
  • api/v1alpha1/zz_generated.deepcopy.go
  • charts/openperouter/charts/crds/templates/network.openperouter.io_l2vnis.yaml
  • config/all-in-one/crio.yaml
  • config/all-in-one/openpe.yaml
  • config/crd/bases/network.openperouter.io_l2vnis.yaml
  • config/samples/l2vni-nodeselector-at-workers.yaml
  • config/samples/l2vni-nodeselector-different-racks.yaml
  • config/samples/l2vni-ovs.yaml
  • config/samples/l2vni.yaml
  • e2etests/scale_tests/scale.go
  • e2etests/tests/bridgerefresh.go
  • e2etests/tests/evpn_l2.go
  • e2etests/tests/frr_restart.go
  • e2etests/tests/ipv6_vtep.go
  • e2etests/tests/l3vpn_l2.go
  • e2etests/tests/resiliency.go
  • e2etests/tests/singlesession.go
  • e2etests/tests/systemd_resiliency.go
  • e2etests/tests/underlay_address_families.go
  • examples/evpn/cni-underlay/openpe.yaml
  • examples/evpn/kubevirt/openpe.yaml
  • examples/evpn/layer2/openpe.yaml
  • examples/evpn/multi-cluster/cluster-a-migration-l2vni.yaml
  • examples/evpn/multi-cluster/cluster-a-openpe.yaml
  • examples/evpn/multi-cluster/cluster-b-migration-l2vni.yaml
  • examples/evpn/multi-cluster/cluster-b-openpe.yaml
  • examples/l3vpn/layer2/openpe.yaml
  • internal/controller/routerconfiguration/static_configuration_reader_test.go
  • internal/conversion/host_conversion.go
  • internal/conversion/host_conversion_test.go
  • internal/conversion/validate_vni_test.go
  • internal/crdschema/crdschema_test.go
  • internal/crdschema/parity_test.go
  • internal/staticconfiguration/reader_test.go
  • internal/staticconfiguration/testdata/openpe_l2vni.yaml
  • internal/staticconfiguration/testdata/openpe_l3vpn.yaml
  • operator/bundle/manifests/network.openperouter.io_l2vnis.yaml
  • website/content/docs/api-reference.md
  • website/content/docs/configuration/evpn.md
  • website/content/docs/configuration/node-selector.md
  • website/content/docs/configuration/srv6.md
  • website/content/docs/examples/evpnexamples/kubevirt-multi-cluster.md
  • website/content/docs/examples/evpnexamples/kubevirt.md
  • website/content/docs/examples/evpnexamples/layer2.md
  • website/content/docs/examples/srv6examples/layer2.md
💤 Files with no reviewable changes (1)
  • api/v1alpha1/zz_generated.deepcopy.go
🚧 Files skipped from review as they are similar to previous changes (37)
  • config/samples/l2vni.yaml
  • internal/staticconfiguration/testdata/openpe_l2vni.yaml
  • config/samples/l2vni-nodeselector-different-racks.yaml
  • internal/conversion/host_conversion_test.go
  • config/samples/l2vni-ovs.yaml
  • examples/l3vpn/layer2/openpe.yaml
  • examples/evpn/cni-underlay/openpe.yaml
  • website/content/docs/examples/srv6examples/layer2.md
  • internal/staticconfiguration/testdata/openpe_l3vpn.yaml
  • examples/evpn/layer2/openpe.yaml
  • charts/openperouter/charts/crds/templates/network.openperouter.io_l2vnis.yaml
  • internal/conversion/host_conversion.go
  • website/content/docs/configuration/srv6.md
  • website/content/docs/examples/evpnexamples/kubevirt-multi-cluster.md
  • e2etests/tests/singlesession.go
  • website/content/docs/examples/evpnexamples/layer2.md
  • examples/evpn/multi-cluster/cluster-b-openpe.yaml
  • examples/evpn/multi-cluster/cluster-a-openpe.yaml
  • e2etests/tests/systemd_resiliency.go
  • website/content/docs/configuration/node-selector.md
  • examples/evpn/multi-cluster/cluster-a-migration-l2vni.yaml
  • internal/conversion/validate_vni_test.go
  • config/all-in-one/openpe.yaml
  • e2etests/tests/resiliency.go
  • internal/crdschema/parity_test.go
  • operator/bundle/manifests/network.openperouter.io_l2vnis.yaml
  • examples/evpn/multi-cluster/cluster-b-migration-l2vni.yaml
  • config/crd/bases/network.openperouter.io_l2vnis.yaml
  • e2etests/tests/bridgerefresh.go
  • internal/staticconfiguration/reader_test.go
  • e2etests/tests/underlay_address_families.go
  • api/v1alpha1/l2vni_types.go
  • e2etests/tests/ipv6_vtep.go
  • e2etests/tests/evpn_l2.go
  • e2etests/tests/l3vpn_l2.go
  • internal/controller/routerconfiguration/static_configuration_reader_test.go
  • internal/crdschema/crdschema_test.go

Comment thread API-DOCS.md Outdated
@qinqon
qinqon force-pushed the api-bridge-lifecycle branch from d564e37 to b82e31b Compare July 29, 2026 13:58
@qinqon
qinqon requested a review from RamLavi July 29, 2026 13:59
@maiqueb

maiqueb commented Jul 29, 2026

Copy link
Copy Markdown
Contributor

@qinqon I've rebased using the magic button ... Please rebase it yourself, and re-push.

I just wanted to check how much better would CI run on the PR.

qinqon added 3 commits July 29, 2026 17:18
Booleans cannot be extended to a third state and do not convey intent.
Replace autoCreate with a lifecycle enum: Managed for the controller
owned br-hs-<VNI> bridge, External for a user provided one. A name
stays valid only for External bridges, as it was with the boolean.

Assisted-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
Output of make generate-all-ci, no hand written changes.

Assisted-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
Replace autoCreate: true with lifecycle: Managed, and a bare bridge
name with lifecycle: External plus the name.

Assisted-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
qinqon added 2 commits July 29, 2026 17:18
The host network layer keeps its own representation, so the enum is
translated into the existing flag during conversion. No behaviour
change.

Assisted-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
Declare Managed or External instead of the auto create toggle;
fixtures attaching to a pre existing bridge become External.

Assisted-By: Claude Opus 5 <noreply@anthropic.com>
Signed-off-by: Enrique Llorente <ellorent@redhat.com>
@qinqon

qinqon commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

@qinqon I've rebased using the magic button ... Please rebase it yourself, and re-push.

I just wanted to check how much better would CI run on the PR.

Done

@RamLavi RamLavi left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@maiqueb
maiqueb merged commit 5012c68 into openperouter:main Jul 30, 2026
22 of 23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants