cloud-provider-openstack
cloud-provider-openstack copied to clipboard
Protect from `AllocateLoadBalancerNodePorts=false`
When aforementioned option is set on the Service .spec
, the NodePorts
stop being set, effectively defaulting .spec.ports[*].nodePort
to 0. When
cloud provider tries to create a member with such a port, Octavia fails.
This commit makes sure we are not adding members when nodePort
value
is 0. We also omit the SG manipulations for such ports.
- openstack-cloud-controller-manager (occm)
What this PR does / why we need it: It's to make sure we are not making requests to Octavia that it cannot fulfill.
Which issue this PR fixes(if applicable): fixes #1996
Special notes for reviewers:
Release note:
NONE
Hi @dulek. Thanks for your PR.
I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test
on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.
Once the patch is verified, the new status will be reflected by the ok-to-test
label.
I understand the commands that are listed here.
Instructions 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/test-infra repository.
@mdbooth, you might want to take a quick look here.
/ok-to-test
When aforementioned option is set on the Service .spec, the NodePorts stop being set, effectively defaulting .spec.ports[*].nodePort to 0. When cloud provider tries to create a member with such a port, Octavia fails.
do you mind create a bug to track this? just want to keep record and know the impact /reason etc as reference
code looks reasonable @dulek but I guess if there's more info in the issue talk about AllocateLoadBalancerNodePorts in commit msg will be helpful as I think it's come from k8s core defintion which lack some background in the PR itself
@jichenjc: I created #1996 as an issue explaining the problem in more details.
@dulek could you please help rebase this? Thanks
Don't we also need to add a guard to ensureAndUpdateOctaviaSecurityGroup() as well?
edit: replying to myself, yes, most likely. The code was added in #1984 after you first submitted your PR.
Done, thanks for spotting this!
@jichenjc: Hi! I've updated the commit message a bit, can you take another look at this?
/lgtm /approve
[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: jichenjc
The full list of commands accepted by this bot can be found here.
The pull request process is described here
- ~~pkg/openstack/OWNERS~~ [jichenjc]
Approvers can indicate their approval by writing /approve
in a comment
Approvers can cancel approval by writing /approve cancel
in a comment