Skip to content

Conversation

@aldokimi
Copy link

@aldokimi aldokimi commented Nov 22, 2025

Summary

Adds complete Trunk resource controller implementation with subport implementation (which is necessary for the Trunk type), dependency handling, and comprehensive test coverage.

Key Features

  • Full CRUD operations for OpenStack trunks
  • Subport reconciliation (add/remove/update)
  • Dependency management (ports, projects)
  • Resource adoption and import support
  • Comprehensive test coverage

Testing

  • Unit tests for all actuator methods
  • Test coverage 35.7%
  • All tests passing

E2E Testing

-All resources are created in the K8s side
-All resources are created in the Openstack side
-All CRUD functionalities are passing the tests

Checklist

  • Code follows project style guidelines
  • Tests added/updated and passing
  • Documentation updated
  • Generated files included
  • No breaking changes

@github-actions github-actions bot added the semver:major Breaking change label Nov 22, 2025
@aldokimi
Copy link
Author

This fixes #364 which is mentioned as well in #577

Copy link
Contributor

@winiciusallan winiciusallan left a comment

Choose a reason for hiding this comment

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

Hi, @aldokimi! I've left a few comments in the API types. Thanks for submitting this pull request, it will be very important in achieving parity with CAPO.


// segmentationType is the type of segmentation to use (e.g., "vlan").
// +required
// +kubebuilder:validation:MaxLength=64
Copy link
Contributor

@winiciusallan winiciusallan Nov 25, 2025

Choose a reason for hiding this comment

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

Did you specify the max length as 64 for some specific reason? The Neutron schema defines the length as 32 bytes

https://github.com/openstack/neutron/blob/master/neutron/services/trunk/models.py#L71


// segmentationID is the segmentation identifier (e.g., VLAN ID).
// +required
SegmentationID int32 `json:"segmentationID"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SegmentationID int32 `json:"segmentationID"`
SegmentationID int16 `json:"segmentationID"`

I'd change to use integers with 16 bits, since in practice neutron only supports VLAN segmentation type (4094 possible IDs) for subports.

Wdyt?

To be honest, I don't know if guidelines restrict usage to only int32 and int64. Can you give an input, @mandre?

Copy link
Contributor

@winiciusallan winiciusallan Nov 26, 2025

Choose a reason for hiding this comment

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

sorry! kubeapi conventions says it MUST be used int32 or int64, so ORC may so.

ignore my suggestion :)

// +required
PortRef KubernetesNameRef `json:"portRef"`

// segmentationType is the type of segmentation to use (e.g., "vlan").
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
// segmentationType is the type of segmentation to use (e.g., "vlan").
// segmentationType is the type of segmentation to use.
// Possible values are "vlan" or "inherit".

If the only two supported types are VLAN and inherit, I think we can quote them here.


// TrunkFilter specifies a filter to select a trunk. At least one parameter must be specified.
// +kubebuilder:validation:MinProperties:=1
type TrunkFilter struct {
Copy link
Contributor

Choose a reason for hiding this comment

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

type Subport struct {
// portRef is a reference to the ORC Port which will be used as a subport.
// +required
PortRef KubernetesNameRef `json:"portRef"`
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
PortRef KubernetesNameRef `json:"portRef"`
PortRef KubernetesNameRef `json:"portRef,omitempty"`

PortID string `json:"portID,omitempty"`

// segmentationType is the type of segmentation used.
// +kubebuilder:validation:MaxLength=1024
Copy link
Contributor

Choose a reason for hiding this comment

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

I believe this should match the same validation in spec for this field.

Name string `json:"name,omitempty"`

// description is a human-readable description for the resource.
// +kubebuilder:validation:MaxLength=1024
Copy link
Contributor

@winiciusallan winiciusallan Nov 25, 2025

Choose a reason for hiding this comment

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

Since we didn't set a max length for the description at spec, I think this could lead to an error - you define a description with 1025+ characters and the controller tries to write the status, but the kube-apiserver fails when validating.

Same for the other fields on this struct.

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

Labels

semver:major Breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants