pyroute2 changed structure of the modules a bit and the unit tests were
assuming it. This commit makes sure tests work with new pyroute2.
Change-Id: I013f2750ca1371d3b4d5e2f618067cd9b70e76e4
It appears that this library is typically run as the root user
which shouldn't require 'run_as_root'. When running as an
unprivileged user the required permissions can be granted by
specifying 'AmbientCapabilities = CAP_NET_ADMIN' in the service,
rather than 'CapabilityBoundingSet'.
An alternative approach would be to specify a 'root_helper' or to
switch to oslo.privsep, but these don't fully solve the problem
as the 'pyroute2' library also requires 'CAP_NET_ADMIN'.
Closes-Bug: #1852105
Change-Id: I9d0942f1cfc06cc3a7585683a030516096297767
PEP8 needs upgrade of hacking version and lower-constraints require us
to start having stuff supporting Python 3.8 in lower-constraints.txt.
Both are fixed by this commit.
Change-Id: I1d0b244f98dbe2228edfcc0caae70b43013a18ad
Now that we no longer support py27, we can use the standard library
unittest.mock module instead of the third party mock lib.
Change-Id: Ibe31e2d17b8baf88c40e00e3beaa019b13594c7c
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
This commit sets the default value of the region_name to 'None' in the
config, this way its avoided the use of a region name
that might not exists on the OpenStack cloud.
Closes-Bug: 1843194
Change-Id: Ic9deca9cb073b5458f5aa063f669b30ae2568f30
kuryr should support neutron client in multi-region scene as follows:
https://bugs.launchpad.net/kuryr/+bug/1831684
Closes-Bug: 1831684
Change-Id: I91315885a56c5cfb313b73b1eddc3935bc200c6c
The api documentation is now published on docs.openstack.org instead
of developer.openstack.org. Update all links that are changed to the
new location.
Note that redirects will be set up as well but let's point now to the
new location.
For details, see:
http://lists.openstack.org/pipermail/openstack-discuss/2019-July/007828.html
Change-Id: Iff96760f90ea1bf71070577ed26ec6767860ea83
This patch replaces parameters for keystone v2 in README and
test codes by the ones for keystone v3, as currently keystone
v2 should not be used anymore.
Change-Id: I6b063dd980e414bfb7c7a94612076690daa85b2d
This adds basic framework for kuryr-status upgrade
check commands. For now it has only "check_placeholder"
check implemented.
Real checks can be added to this tool in the future.
Change-Id: I8af38f087672a390ec8b2b78916315b5a646fcbb
Story: 2003657
Task: 26137
On port binding/unbinding, Kuryr catches exception raised from
pyroute2 and re-raise a new exception. As a result, the detailed
information contained in the original exception loses. This patch
adds a logging to record the original exception message and trace.
Related-Bug: #1776035
Change-Id: I4b13724a460d84a2b953f750b8b88c0f60cee97d
In before, only one binding driver is allowed. This patch introduces
a new config to support multiple binding drivers. The first use case
is to allow SR-IOV binding to be co-existed with other binding.
* Rename the config 'driver' to 'default_driver' in 'binding' group.
This is for making it clear that it is allowed to have more than
one type of bindings.
* Introduce a new config called 'enabled_drivers'.
* Allow client to pass a driver name to port_bind and port_unbind.
If this parameter is None, kuryr will load the default driver.
Partial-Implements: blueprint sriov-binding
Change-Id: I14b23379de9f2459ba97d5d82dfdb51553370cb1
The driver is for binding/unbinding SR-IOV port. Basically,
what it does is setting the vlan id for the VF interface.
Change-Id: Ife43b57a11c9aac9c0bece84adf719e62f708fda
Partial-Implements: blueprint sriov-binding
Pyroute2 was updated, its change make some testcases failed.
This patch fix the problem with pyroute2 update.
Change-Id: I300f9830927a8babf9112f9aff265ef4b2e5e03e
Closes-Bug: #1700469
This patch adds unit test for veth binding driver,
this change is mostly based on the previously test_package.
Change-Id: I2ba8dafbe31243608bf0c4ae68e8324ec7e27157
Partial-Bug: #1644403
This patch modifies allocate_segmentation_id so that the vlan_id
returned is randomly selected between the available ids.
The main rationale behind is to avoid vlan_id collisions, for
instance in active-active deployments, among different calls.
Note this will minimize the collision if nested containers are
created by using both kubernetes and docker in the same VM.
Partially Implements blueprint containers-in-instances
Change-Id: Iba2c94707c4932d59483c793452da88c43d4215c
* Split get_neutron_client into three methods: get_neutron_client,
get_auth_plugin, and get_keystone_session.
* Split register_neutron_opts into two methods:
register_neutron_opts and register_keystoneauth_opts
* Split list_neutron_opts into two methods: list_neutron_opts
and get_keystoneauth_conf_options
This allows Fuxi to reuse the keystone code to get a cinder
client and generate sample config.
Change-Id: I9053b6d1a669d471a4c6b447fb72591a421a8caa
The name of neutron config group is specified in file
kuryr/lib/config.py. If we want to retrieve the name of this config
group, we should read it from that file instead of hard-coding it.
Change-Id: Id6ebc4fc8433a802edc04b941a591e03d23c489e
Commit fd904a6a656e338ece36f5353273bcb7220066ee uses an exception from
kuryr lib. However, it missed to add the exception.
Change-Id: I52507a547a5f20254e86a0b5cda9eb0b70617ead
Closes-Bug: #1651062
Add support to enable isolation of container's traffic within
host(nova instances) using vlan segmentations.
Partially Implements blueprint containers-in-instances
Change-Id: If4800594adfac27a8f30dedac4787d79c8634b65
Currently ipaddress is being set from nova instance port and thus
making vm ip and container ip same. Fix this by using container port
dict for getting container IP.
Another change is renaming 'nested_port', which is actually Nova
instance port, to 'vm_port', for the sake of avoiding ambiguity.
Change-Id: I9ea93c88c2889c5a6b7eff230ffdfb87b96b0e25
Closes-bug: #1641537
When neutron configured with linux bridge driver, kuryr will bind
port error. The linux bridge name should be "brq"+network_id[0,11].
Change-Id: I07be68bbfe7b1384f4e946664aed41546ff9ddce
Closes-bug: #1638041