Repository navigation
allow port ranges in floating ip portforwarding - #3756
Conversation
winiciusallan
left a comment
There was a problem hiding this comment.
Could you please add some unit and acceptance tests?
|
Well, InternalPort is not filterable either but was in that block, but I’ll remove it if you like
b
… On May 15, 2026, at 4:28 PM, Winicius Allan ***@***.***> wrote:
@winiciusallan commented on this pull request.
Could you please add some unit <https://github.com/gophercloud/gophercloud/tree/main/openstack/networking/v2/extensions/layer3/portforwarding/testing> and acceptance <https://github.com/gophercloud/gophercloud/blob/main/internal/acceptance/openstack/networking/v2/extensions/layer3/portforwardings_test.go> tests?
In openstack/networking/v2/extensions/layer3/portforwarding/requests.go <#3756 (comment)>:
> InternalIPAddress string `q:"internal_ip_address"`
Protocol string `q:"protocol"`
InternalPort string `q:"internal_port"`
+ InternalPortRange string `q:"internal_port_range"`
Per the API documentation[1], this field is not a valid filter[2]. So, I believe we shouldn't have this here.
[1] https://docs.openstack.org/api-ref/network/v2/index.html#list-floating-ip-port-forwardings
[2] https://github.com/openstack/neutron-lib/blob/master/neutron_lib/api/definitions/fip_pf_port_range.py#L35
—
Reply to this email directly, view it on GitHub <#3756 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABMRU5YJTRX2ITZA4COCHJL424SPVAVCNFSM6AAAAACY7QGXX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DEOJYHAYTSNJQHA>.
You are receiving this because you authored the thread.
|
|
@mandre would you mind taking a look and probably triggering the tests? 😃 |
|
Yep, sorry about that. I missed that one. Changed and pushed.
b
… On May 19, 2026, at 8:58 PM, Winicius Allan ***@***.***> wrote:
@winiciusallan commented on this pull request.
In openstack/networking/v2/extensions/layer3/portforwarding/results.go <#3756 (comment)>:
> // The IP protocol used in the floating IP port forwarding.
Protocol string `json:"protocol"`
// The TCP/UDP/other protocol port number of the Neutron port fixed
// IP address associated to the floating ip port forwarding.
InternalPort int `json:"internal_port"`
+ // The TCP/UDP/other protocol port number of the Neutron port fixed
I believe this would fit better according to the api reference <https://docs.openstack.org/api-ref/network/v2/index.html#id216>. What do you think?
⬇️ Suggested change
- // The TCP/UDP/other protocol port number of the Neutron port fixed
+ // The TCP/UDP/other protocol port range of the Neutron port fixed
—
Reply to this email directly, view it on GitHub <#3756 (review)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/ABMRU5YNMUMNPVJIVLAFUOT43SVFHAVCNFSM6AAAAACY7QGXX2VHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHM2DGMRSGE4TAMZWHA>.
You are receiving this because you authored the thread.
|
|
@rjmercier1 please fix formatting issues to pass linter tests |
|
I think I fixed the linter issue (sorry, kinda new to this w/golang) |
|
@rjmercier1 can you rebase the main branch into your branch so we get this fix for the also, looks like the unit tests failed due to a problem on the Coveralls server's side. |
|
@winiciusallan test infra now automatically rebases on target branch. This is a new error, see also #3760. Probably relates to https://bugs.launchpad.net/neutron/+bug/2152241, but I'm not sure. |
|
@winiciusallan I did the rebase but there didnt seem to be any changes. Update: Figured out how to update upstream and have merged latest with my fork |
|
Does anything else need to be done for this PR? |
|
Thanks for your work until now!
The PR looks good, but for completeness, and to cover operations against those fields, I would also add unit tests here in this package The failing CI job is unrelated to your changes, so this shouldn't be blocking. Would you mind taking a look at the changes, @kayrus? |
|
@kayrus I see the PRs I opened on gophercloud/utils and terraform-openstack-provider/utils have been closed. It looks like some attempt was made to move towards the openstack provider using it's own utils but there are still dozens of references to gophercloud/utils in the provider code. How to proceed? |
As I mentioned they're not related to this PR. Once this PR is merged, it will be backported to v2 branch, which is currently used by terraform provider and utils. |
8971697 to
8ef9b2a
Compare
mandre
left a comment
There was a problem hiding this comment.
Thanks for the PR 😃
I noticed a few nits that should be addressed before merging, nothing dramatic.
Fixes #3750
Added acceptance tests ranges:
=== RUN TestLayer3PortForwardingsCreateDelete
networking.go:35: Attempting to create network: TESTACC-OSTY0pea
networking.go:42: Successfully created network.
networking.go:305: Attempting to create subnet: TESTACC-3C9Bc0xM
networking.go:312: Successfully created subnet.
layer3.go:155: Attempting to create external router: TESTACC-6aVUKGog
layer3.go:178: Created router: TESTACC-6aVUKGog
networking.go:85: Attempting to create port: TESTACC-ysyRcBdk
networking.go:109: Successfully created port: TESTACC-ysyRcBdk
layer3.go:221: Attempting to add port b510e931-d475-45fd-a34a-4585b82bd1dd to router a257972a-fda3-484c-91eb-6060bd78006f
layer3.go:236: Successfully added port b510e931-d475-45fd-a34a-4585b82bd1dd to router a257972a-fda3-484c-91eb-6060bd78006f
layer3.go:24: Attempting to create floating IP on port:
layer3.go:38: Created floating IP.
tools.go:89: {
"id": "04f3adc1-7c84-4c41-8abc-9998c9040dfe",
"description": "Test floating IP",
"floating_network_id": "97a60fd4-aa21-436f-ba06-97b00865c6b0",
"floating_ip_address": "149.255.36.136",
"port_id": "",
"fixed_ip_address": "",
"tenant_id": "ba25a7a11cda4a3f8f88681a9fed7934",
"project_id": "ba25a7a11cda4a3f8f88681a9fed7934",
"status": "DOWN",
"router_id": "",
"tags": [],
"revision_number": 0
}
layer3.go:74: Attempting to create Port forwarding for floating IP with ID: 04f3adc1-7c84-4c41-8abc-9998c9040dfe
layer3.go:93: Created Port Forwarding.
tools.go:89: {
"id": "59000e6a-7642-47d5-8b1f-1532520b8eab",
"description": "Test description",
"internal_port_id": "b510e931-d475-45fd-a34a-4585b82bd1dd",
"external_port": 2230,
"external_port_range": "2230:2230",
"protocol": "tcp",
"internal_port": 25,
"internal_port_range": "25:25",
"internal_ip_address": "192.168.54.184"
}
layer3.go:103: Attempting to create Port Range forwarding for floating IP with ID: 04f3adc1-7c84-4c41-8abc-9998c9040dfe
layer3.go:122: Created Port Range Forwarding.
tools.go:89: {
"id": "3172eb85-a518-465b-93f9-c2e23cf1a111",
"description": "Test description range",
"internal_port_id": "b510e931-d475-45fd-a34a-4585b82bd1dd",
"external_port": 0,
"external_port_range": "1200:1299",
"protocol": "tcp",
"internal_port": 0,
"internal_port_range": "1200:1299",
"internal_ip_address": "192.168.54.184"
}
layer3.go:132: Attempting to delete the port forwarding with ID 3172eb85-a518-465b-93f9-c2e23cf1a111 for floating IP with ID 04f3adc1-7c84-4c41-8abc-9998c9040dfe
layer3.go:138: Successfully deleted the port forwarding with ID 3172eb85-a518-465b-93f9-c2e23cf1a111 for floating IP with ID 04f3adc1-7c84-4c41-8abc-9998c9040dfe
layer3.go:132: Attempting to delete the port forwarding with ID 59000e6a-7642-47d5-8b1f-1532520b8eab for floating IP with ID 04f3adc1-7c84-4c41-8abc-9998c9040dfe
layer3.go:138: Successfully deleted the port forwarding with ID 59000e6a-7642-47d5-8b1f-1532520b8eab for floating IP with ID 04f3adc1-7c84-4c41-8abc-9998c9040dfe
layer3.go:305: Attempting to delete floating IP: 04f3adc1-7c84-4c41-8abc-9998c9040dfe
layer3.go:312: Deleted floating IP: 04f3adc1-7c84-4c41-8abc-9998c9040dfe
layer3.go:283: Attempting to detach port b510e931-d475-45fd-a34a-4585b82bd1dd from router a257972a-fda3-484c-91eb-6060bd78006f
layer3.go:298: Successfully detached port b510e931-d475-45fd-a34a-4585b82bd1dd from router a257972a-fda3-484c-91eb-6060bd78006f
layer3.go:265: Attempting to delete router: a257972a-fda3-484c-91eb-6060bd78006f
layer3.go:276: Deleted router: a257972a-fda3-484c-91eb-6060bd78006f
networking.go:553: Attempting to delete subnet: 53265daf-13bd-4bed-ac97-480d865bfefb
networking.go:560: Deleted subnet: 53265daf-13bd-4bed-ac97-480d865bfefb
networking.go:525: Attempting to delete network: 724286e5-306a-448e-9d9a-d1b7289b91c6
networking.go:532: Deleted network: 724286e5-306a-448e-9d9a-d1b7289b91c6
--- PASS: TestLayer3PortForwardingsCreateDelete (17.72s)
PASS
ok github.com/gophercloud/gophercloud/v2/internal/acceptance/openstack/networking/v2/extensions/layer3 17.722s