Permalink
Browse files

Adds the user's project id to the VIP port creation

This brings Octavia in line with what n-lbaas does for VIP port and
allows a user to attach a FIP to the VIP port generated by Octavia.

Change-Id: Ib7e6374cad49a16a733dacb2ea1ca096d8c4e6e4
(cherry picked from commit 0f4a5e2)
  • Loading branch information...
xgerman committed Nov 29, 2017
1 parent d2fad0b commit ff15dde793ecbb7450660ec23c39a124c0398575
@@ -344,7 +344,8 @@ def allocate_vip(self, load_balancer):
'network_id': load_balancer.vip.network_id,
'admin_state_up': False,
'device_id': 'lb-{0}'.format(load_balancer.id),
'device_owner': OCTAVIA_OWNER}}
'device_owner': OCTAVIA_OWNER,
'project_id': load_balancer.project_id}}
if fixed_ip:
port['port']['fixed_ips'] = [fixed_ip]
@@ -376,7 +376,8 @@ def test_allocate_vip_when_no_port_provided(self):
}}
fake_lb_vip = data_models.Vip(subnet_id=t_constants.MOCK_SUBNET_ID,
network_id=t_constants.MOCK_NETWORK_ID)
fake_lb = data_models.LoadBalancer(id='1', vip=fake_lb_vip)
fake_lb = data_models.LoadBalancer(id='1', vip=fake_lb_vip,
project_id='test-project')
vip = self.driver.allocate_vip(fake_lb)
exp_create_port_call = {
'port': {
@@ -385,6 +386,7 @@ def test_allocate_vip_when_no_port_provided(self):
'device_id': 'lb-1',
'device_owner': allowed_address_pairs.OCTAVIA_OWNER,
'admin_state_up': False,
'project_id': 'test-project',
'fixed_ips': [{'subnet_id': t_constants.MOCK_SUBNET_ID}]
}
}
@@ -0,0 +1,9 @@
---
fixes:
- |
Neutron LBaaS was assigning the VIP port it created the user's project-id,
thus allowing the user to attach Floating-IPs to the VIP port. Octavia,
on the other hand, was assigning the Octavia project-id to the port, making
it impossible for the user to attach a Floating IP. This patch brings
Octavia's behavior in line with Neutron LBaaS and assigns the user's
project-id to the VIP port created by Octavia.

0 comments on commit ff15dde

Please sign in to comment.