🐛 Use port_trusted_vif extension for trusted VF when available#3120
🐛 Use port_trusted_vif extension for trusted VF when available#3120larainema wants to merge 1 commit intokubernetes-sigs:mainfrom
Conversation
When creating ports with TrustedVF enabled, check if the Neutron port_trusted_vif extension is available. If it is, set the trusted attribute via the dedicated port field instead of through binding:profile. This follows the deprecation of setting trusted directly in binding:profile in recent Neutron releases. Falls back to the old binding:profile approach when the extension is not available for backward compatibility.
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
✅ Deploy Preview for kubernetes-sigs-cluster-api-openstack ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
|
Hi @larainema. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
/ok-to-test |
What this PR does / why we need it
In recent Neutron (2024.2+), setting
trusteddirectly in a port'sbinding:profilehas been deprecated. A new API extensionport-trusted-vifadds a dedicatedtrustedboolean field to the port resource, which should be used instead.This PR adapts CAPO to use the new extension when available, with backward compatibility for older Neutron deployments.
Which issue(s) this PR fixes:
Fixes #2172
Changes
Port creation (
pkg/cloud/services/networking/port.go)HasPortTrustedVIFExtension()method that checks if theport-trusted-vifNeutron extension is available (follows the same pattern asGetTrunkSupport())EnsurePortto check for the extension whenTrustedVFis set. If available, wraps the create opts withportstrustedvif.PortCreateOptsExtinstead of puttingtrustedinbinding:profilegetPortProfileto accept ausePortTrustedVIFflag so it skips addingtrustedto the binding:profile when the extension handles itTests (
pkg/cloud/services/networking/port_test.go)ListExtensionsreturning noport-trusted-vifextension (backward compatibility path)Behavior
port-trusted-vifavailable?trusted: trueset inbinding:profile(unchanged)trusted: trueset via dedicated port attributeSpecial notes for your reviewer
portstrustedvifpackage, so no dependency updates are needed.ListExtensions(), the same API used for trunk support checking.References
ALIAS = 'port-trusted-vif'inneutron_lib/api/definitions/port_trusted_vif.pygophercloud/v2/openstack/networking/v2/extensions/portstrustedvif