Skip to content

Conversation

dukov
Copy link
Collaborator

@dukov dukov commented Sep 24, 2025

⚠️ DO NOT MERGE - REVIEW ONLY

This PR is for code review purposes only. The feature branch will be
integrated during the release process.

What this implements

This adds the ability to specify subports when creating trunk ports. Users can now define VLAN subports that will be attached to the trunk when the port is created.

Example usage:

  ports:
  - network: 
       filter:
         name: foo_vlan_300
     trunk: true 
     subports:
     - network:
          filter:
            name: bar_vlan_301
        segmentationID: 301
        segmentationType: "vlan"
  • Added SubportOpts and ResolvedSubportSpec types to API
  • Since sub-ports and ports are essentially the same entities CommonPortOpts and CommonResolvedPortSpec types were introduced as a basis for regular ports and trunk subports
  • Added SubPortStatus to keep track of ports which are associated with trunk
  • Introduced separate method for adding supports to trunk
  • Added AddSubports method to NetworkClient interface
  • Added validation to ensure subports require trunk enabled
  • Updated port normalization to resolve subports

Testing done

  • unit test
  • tests on real env

@bnallapeta
Copy link
Member

Looks good overall. Below points need to be addressed:

  1. Docs are missing. Users need to know how to use the new fields. Perhaps under configuration.md ? Make it clear in the docs that the existing functionality is not changed while adding in our new way.
  2. e2e tests only have the old way. We need to add new tests to test the new fields.
  3. unit tests: consider adding negative cases (invalid vlan ID, multiple subports and more).

@bnallapeta
Copy link
Member

lgtm

This adds the ability to specify subports when creating trunk ports.
Users can now define VLAN subports that will be attached to the trunk
when the port is created.

Example usage:
  ports:
  - network:
      filter:
        name: foo_vlan_300
    trunk: true
    subports:
    - network:
        filter:
          name: bar_vlan_301
      segmentationID: 301
      segmentationType: "vlan"

- Added SubportOpts and ResolvedSubportSpec types to API
- Since sub-ports and ports are essentially the same entities
  CommonPortOpts and CommonResolvedPortSpec types were introduced as a
  basis for regular ports and trunk subports
- Added SubPortStatus to keep track of ports which are associated with
  trunk
- Introduced separate method for adding supports to trunk
- Added AddSubports method to NetworkClient interface
- Added validation to ensure subports require trunk enabled
- Updated port normalization to resolve subports
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants