summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--devstack/plugin.sh4
-rw-r--r--doc/requirements.txt12
-rw-r--r--doc/source/contributor/index.rst1
-rw-r--r--doc/source/contributor/release-notes.rst154
-rw-r--r--releasenotes/notes/support-backup-strategy.yaml (renamed from releasenotes/notes/victoria-support-backup-strategy.yaml)0
-rw-r--r--releasenotes/notes/support-online-resize.yaml (renamed from releasenotes/notes/victoria-support-online-resize.yaml)0
-rw-r--r--releasenotes/notes/support-subnet-and-ip-address.yaml (renamed from releasenotes/notes/victoria-support-subnet-and-ip-address.yaml)0
-rw-r--r--releasenotes/templates/feature.yml7
-rw-r--r--releasenotes/templates/fix.yml7
-rw-r--r--tox.ini14
-rw-r--r--trove/common/cfg.py2
-rw-r--r--trove/instance/models.py16
-rw-r--r--trove/tests/fakes/dns.py7
-rw-r--r--trove/tests/fakes/nova.py8
-rw-r--r--trove/tests/unittests/cluster/test_cluster_views.py8
-rw-r--r--trove/tests/unittests/instance/test_instance_models.py26
-rw-r--r--trove/tests/unittests/instance/test_instance_views.py28
17 files changed, 255 insertions, 39 deletions
diff --git a/devstack/plugin.sh b/devstack/plugin.sh
index 01800907..2b34158e 100644
--- a/devstack/plugin.sh
+++ b/devstack/plugin.sh
@@ -538,7 +538,9 @@ function config_trove_network {
if [[ "$shared" == "False" ]]; then
openstack network set ${PRIVATE_NETWORK_NAME} --share
fi
- sudo ip route replace ${IPV4_ADDRS_SAFE_TO_USE} via $ROUTER_GW_IP
+ if [[ -n ${ROUTER_GW_IP} && -n ${IPV4_ADDRS_SAFE_TO_USE} ]]; then
+ sudo ip route replace ${IPV4_ADDRS_SAFE_TO_USE} via $ROUTER_GW_IP
+ fi
# Make sure we can reach the management port of the service VM, this
# configuration is only for testing purpose. In production, it's
diff --git a/doc/requirements.txt b/doc/requirements.txt
new file mode 100644
index 00000000..da3f3abf
--- /dev/null
+++ b/doc/requirements.txt
@@ -0,0 +1,12 @@
+# The order of packages is significant, because pip processes them in the order
+# of appearance. Changing the order has an impact on the overall integration
+# process, which may cause wedges in the gate later.
+# Order matters to the pip dependency resolver, so sorting this file
+# changes how packages are installed. New dependencies should be
+# added in alphabetical order, however, some dependencies may need to
+# be installed in a specific order.
+openstackdocstheme>=2.2.1 # Apache-2.0
+reno>=3.1.0 # Apache-2.0
+sphinx>=2.0.0,!=2.1.0 # BSD
+sphinxcontrib-svg2pdfconverter>=0.1.0 # BSD
+whereto>=0.3.0 # Apache-2.0
diff --git a/doc/source/contributor/index.rst b/doc/source/contributor/index.rst
index 43b5a13b..3ba2f00e 100644
--- a/doc/source/contributor/index.rst
+++ b/doc/source/contributor/index.rst
@@ -13,3 +13,4 @@ functionality, the following resources are provided.
design
functional_test
testing
+ release-notes
diff --git a/doc/source/contributor/release-notes.rst b/doc/source/contributor/release-notes.rst
new file mode 100644
index 00000000..30923ffa
--- /dev/null
+++ b/doc/source/contributor/release-notes.rst
@@ -0,0 +1,154 @@
+.. _release-notes:
+
+=============
+Release notes
+=============
+
+Introduction
+~~~~~~~~~~~~
+
+Trove uses the following release notes sections:
+
+- ``features`` --- for new features or functionality; these should ideally
+ refer to the blueprint being implemented;
+- ``fixes`` --- for fixes closing bugs; these must refer to the bug being
+ closed;
+- ``upgrade`` --- for notes relevant when upgrading from previous version;
+ these should ideally be added only between major versions; required when
+ the proposed change affects behaviour in a non-backwards compatible way or
+ generally changes something impactful;
+- ``deprecations`` --- to track deprecated features; relevant changes may
+ consist of only the commit message and the release note;
+- ``prelude`` --- filled in by the PTL or Cores before each release or RC.
+
+Other release note types may be applied per common sense.
+Each change should include a release note unless being a ``TrivialFix``
+change or affecting only docs or CI. Such changes should `not` include
+a release note to avoid confusion.
+Remember release notes are mostly for end users which, in case of Trove,
+are OpenStack administrators/operators.
+In case of doubt, the core team will let you know what is required.
+
+To add a release note, run the following command:
+
+.. code-block:: console
+
+ tox -e venv -- reno new <summary-line-with-dashes>
+
+All release notes can be inspected by browsing ``releasenotes/notes``
+directory. Further on this page we show reno templates, examples and how to
+make use of them.
+
+.. note::
+
+ The term `release note` is often abbreviated to `reno` as it is the name of
+ the tool that is used to manage the release notes.
+
+To generate renos in HTML format in ``releasenotes/build``, run:
+
+.. code-block:: console
+
+ tox -e releasenotes
+
+Note this requires the release note to be tracked by ``git`` so you
+have to at least add it to the ``git``'s staging area.
+
+The release notes are linted in the CI system. To lint locally, run:
+
+.. code-block:: console
+
+ tox -e pep8
+
+The above lints all of documentation at once.
+
+Templates and examples
+~~~~~~~~~~~~~~~~~~~~~~
+
+All approved release notes end up being published on a dedicated site:
+
+ https://docs.openstack.org/releasenotes/trove/
+
+When looking for examples, it is advised to consider browsing the page above
+for a similar type of change and then comparing with their source
+representation in ``releasenotes/notes``.
+
+The sections below give further guidelines. Please try to follow them but note
+they are not set in stone and sometimes a different wording might be more
+appropriate. In case of doubt, the core team will be happy to help.
+
+Features
+--------
+
+Template
+++++++++
+
+.. path releasenotes/templates/feature.yml
+.. code-block:: yaml
+
+ ---
+ features:
+ - |
+ Implements [some feature].
+ [Can be described using multiple sentences if necessary.]
+ [Limitations worth mentioning can be included as well.]
+ `Stroy [Story id] <https://storyboard.openstack.org/#!/story/[Story id]>`__
+
+
+Example
++++++++
+
+Implementing blueprint with id `letsencrypt-https`, we use ``reno`` to generate
+the scaffolded file:
+
+.. code-block:: console
+
+ tox -e venv -- reno new --from-template releasenotes/templates/feature.yml blueprint-letsencrypt-https
+
+And then fill it out with the following content:
+
+.. code-block:: yaml
+
+ ---
+ features:
+ - |
+ Implements support for hassle-free integration with Let's Encrypt.
+ The support is limited to operators in the underworld.
+ For more details check the TLS docs of Trove.
+ `Stroy xxx <https://storyboard.openstack.org/#!/story/xxx>`__
+
+
+Fixes
+-----
+
+Template
+++++++++
+
+.. path releasenotes/templates/fix.yml
+.. code-block:: yaml
+
+ ---
+ fixes:
+ - |
+ Fixes [some bug].
+ [Can be described using multiple sentences if necessary.]
+ [Possibly also giving the previous behaviour description.]
+ `Stroy [Story id] <https://storyboard.openstack.org/#!/story/[Story id]>`__
+
+Example
++++++++
+
+Fixing bug number `1889611`, we use ``reno`` to generate the scaffolded file:
+
+.. code-block:: console
+
+ tox -e venv -- reno new --from-template releasenotes/templates/fix.yml bug-1889611
+
+And then fill it out with the following content:
+
+.. code-block:: yaml
+
+ ---
+ fixes:
+ - |
+ Fixes ``create-datastore`` action doesn't work for the mysql datastore.
+ `LP#xxx <https://storyboard.openstack.org/#!/story/xxx>`__
diff --git a/releasenotes/notes/victoria-support-backup-strategy.yaml b/releasenotes/notes/support-backup-strategy.yaml
index 97b9335c..97b9335c 100644
--- a/releasenotes/notes/victoria-support-backup-strategy.yaml
+++ b/releasenotes/notes/support-backup-strategy.yaml
diff --git a/releasenotes/notes/victoria-support-online-resize.yaml b/releasenotes/notes/support-online-resize.yaml
index f5218013..f5218013 100644
--- a/releasenotes/notes/victoria-support-online-resize.yaml
+++ b/releasenotes/notes/support-online-resize.yaml
diff --git a/releasenotes/notes/victoria-support-subnet-and-ip-address.yaml b/releasenotes/notes/support-subnet-and-ip-address.yaml
index e7037ec5..e7037ec5 100644
--- a/releasenotes/notes/victoria-support-subnet-and-ip-address.yaml
+++ b/releasenotes/notes/support-subnet-and-ip-address.yaml
diff --git a/releasenotes/templates/feature.yml b/releasenotes/templates/feature.yml
new file mode 100644
index 00000000..33d5c537
--- /dev/null
+++ b/releasenotes/templates/feature.yml
@@ -0,0 +1,7 @@
+---
+features:
+ - |
+ Implements [some feature].
+ [Can be described using multiple sentences if necessary.]
+ [Limitations worth mentioning can be included as well.]
+ `Stroy [Story id] <https://storyboard.openstack.org/#!/story/[story id]>`__
diff --git a/releasenotes/templates/fix.yml b/releasenotes/templates/fix.yml
new file mode 100644
index 00000000..13e51f83
--- /dev/null
+++ b/releasenotes/templates/fix.yml
@@ -0,0 +1,7 @@
+---
+fixes:
+ - |
+ Fixes [some bug].
+ [Can be described using multiple sentences if necessary.]
+ [Possibly also giving the previous behaviour description.]
+ `LP#[Story id] <https://storyboard.openstack.org/#!/story/[Story id]>`__
diff --git a/tox.ini b/tox.ini
index 799454a6..c35a01df 100644
--- a/tox.ini
+++ b/tox.ini
@@ -26,9 +26,15 @@ allowlist_externals = find
bash
[testenv:pep8]
+deps =
+ -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
+ -r{toxinidir}/test-requirements.txt
commands =
flake8
+ reno lint
doc8 {posargs}
+ doc8 -e '.yaml' releasenotes/notes/
+ doc8 doc/source
[testenv:debug]
commands = oslo_debug_helper {posargs}
@@ -79,7 +85,13 @@ commands =
sphinx-build -W -b html -d api-ref/build/doctrees api-ref/source api-ref/build/html
[testenv:releasenotes]
-commands = sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
+deps =
+ -c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
+ -r{toxinidir}/doc/requirements.txt
+allowlist_externals = rm
+commands =
+ rm -rf releasenotes/build
+ sphinx-build -a -E -W -d releasenotes/build/doctrees -b html releasenotes/source releasenotes/build/html
[testenv:bandit]
commands = bandit -r trove -n5 -x tests
diff --git a/trove/common/cfg.py b/trove/common/cfg.py
index 6270d96d..58dd3af6 100644
--- a/trove/common/cfg.py
+++ b/trove/common/cfg.py
@@ -449,6 +449,8 @@ common_opts = [
'the datastores supported by Trove.'),
cfg.StrOpt('docker_bridge_network_ip', default=None,
help='Docker bridge network IP.'),
+ cfg.StrOpt('docker_insecure_registries', default=[],
+ help='Docker insecure registries for image development.'),
cfg.StrOpt('template_path', default='/etc/trove/templates/',
help='Path which leads to datastore templates.'),
cfg.BoolOpt('sql_query_logging', default=False,
diff --git a/trove/instance/models.py b/trove/instance/models.py
index 3e2d9854..8469f174 100644
--- a/trove/instance/models.py
+++ b/trove/instance/models.py
@@ -266,14 +266,13 @@ class SimpleInstance(object):
return None
IPs = []
- for address_list in self.addresses.values():
- for addr_info in address_list:
- if CONF.ip_regex and CONF.black_list_regex:
- if not ip_visible(addr_info['addr'], CONF.ip_regex,
- CONF.black_list_regex):
- continue
+ for address in self.addresses:
+ if CONF.ip_regex and CONF.black_list_regex:
+ if not ip_visible(address['address'], CONF.ip_regex,
+ CONF.black_list_regex):
+ continue
- IPs.append(addr_info['addr'])
+ IPs.append(address)
return IPs
@@ -1045,6 +1044,9 @@ class BaseInstance(SimpleInstance):
# default range(172.17.0.0/16) of bridge network
if CONF.docker_bridge_network_ip:
docker_daemon_values["bip"] = CONF.docker_bridge_network_ip
+ if CONF.docker_insecure_registries:
+ docker_daemon_values["insecure-registries"] = \
+ CONF.docker_insecure_registries.split(',')
if docker_daemon_values:
files['/etc/docker/daemon.json'] = (
diff --git a/trove/tests/fakes/dns.py b/trove/tests/fakes/dns.py
index d65bbbd8..865ed176 100644
--- a/trove/tests/fakes/dns.py
+++ b/trove/tests/fakes/dns.py
@@ -78,9 +78,8 @@ class FakeDnsChecker(object):
# the ability to return the IP from the API as well as a hostname,
# since that lines up to the DnsEntry's content field.
ip_addresses = mgmt_instance.server['addresses']
- for network_name, ip_list in ip_addresses.items():
- for ip in ip_list:
- if entry.content == ip['addr']:
- return
+ for address in ip_addresses:
+ if entry.content == address['address']:
+ return
fail("Couldn't find IP address %s among these values: %s"
% (entry.content, ip_addresses))
diff --git a/trove/tests/fakes/nova.py b/trove/tests/fakes/nova.py
index a0779147..88df4d89 100644
--- a/trove/tests/fakes/nova.py
+++ b/trove/tests/fakes/nova.py
@@ -17,6 +17,7 @@ import collections
import uuid
import eventlet
+
from novaclient import exceptions as nova_exceptions
from oslo_log import log as logging
@@ -128,7 +129,10 @@ class FakeServer(object):
@property
def addresses(self):
- return {"private": [{"addr": "123.123.123.123"}]}
+ return [{
+ "address": "123.123.123.123",
+ 'type': 'private',
+ 'network': 'net-id'}]
def confirm_resize(self):
if self.status != "VERIFY_RESIZE":
@@ -576,7 +580,7 @@ class FakeHost(object):
'status': server.status
})
if (str(server.flavor_ref).startswith('http:') or
- str(server.flavor_ref).startswith('https:')):
+ str(server.flavor_ref).startswith('https:')):
flavor = FLAVORS.get_by_href(server.flavor_ref)
else:
flavor = FLAVORS.get(server.flavor_ref)
diff --git a/trove/tests/unittests/cluster/test_cluster_views.py b/trove/tests/unittests/cluster/test_cluster_views.py
index 9833da96..19fbbc43 100644
--- a/trove/tests/unittests/cluster/test_cluster_views.py
+++ b/trove/tests/unittests/cluster/test_cluster_views.py
@@ -83,15 +83,15 @@ class ClusterViewTest(trove_testtools.TestCase):
cluster.instances.append(Mock())
cluster.instances[0].type = 'configsvr'
cluster.instances[0].get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
cluster.instances[0].datastore_version.manager = 'mongodb'
cluster.instances[1].type = 'query_router'
cluster.instances[1].get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
cluster.instances[1].datastore_version.manager = 'mongodb'
cluster.instances[2].type = 'member'
cluster.instances[2].get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
cluster.instances[2].datastore_version.manager = 'mongodb'
def test_case(ip_to_be_published_for,
@@ -128,7 +128,7 @@ class ClusterInstanceDetailViewTest(trove_testtools.TestCase):
self.instance.volume_used = '3'
self.instance.root_password = 'iloveyou'
self.instance.get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
self.instance.slave_of_id = None
self.instance.slaves = None
self.context = trove_testtools.TroveTestContext(self)
diff --git a/trove/tests/unittests/instance/test_instance_models.py b/trove/tests/unittests/instance/test_instance_models.py
index 96ab8726..6283a12c 100644
--- a/trove/tests/unittests/instance/test_instance_models.py
+++ b/trove/tests/unittests/instance/test_instance_models.py
@@ -11,9 +11,10 @@
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
# License for the specific language governing permissions and limitations
# under the License.
+import uuid
+
from unittest.mock import Mock
from unittest.mock import patch
-import uuid
from trove.backup import models as backup_models
from trove.common import cfg
@@ -25,9 +26,9 @@ from trove.instance import models
from trove.instance.models import DBInstance
from trove.instance.models import DBInstanceFault
from trove.instance.models import Instance
-from trove.instance.models import instance_encryption_key_cache
from trove.instance.models import InstanceServiceStatus
from trove.instance.models import SimpleInstance
+from trove.instance.models import instance_encryption_key_cache
from trove.instance.service_status import ServiceStatuses
from trove.instance.tasks import InstanceTasks
from trove.taskmanager import api as task_api
@@ -50,12 +51,17 @@ class SimpleInstanceTest(trove_testtools.TestCase):
ServiceStatuses.BUILDING), ds_version=Mock(), ds=Mock(),
locality='affinity')
self.instance.context = self.context
- db_info.addresses = {
- 'private': [
- {'version': 4, 'addr': '123.123.123.123'},
- {'version': 4, 'addr': '10.123.123.123'}],
- 'public': [
- {'version': 4, 'addr': '15.123.123.123'}]}
+ db_info.addresses = [{
+ 'type': 'private',
+ 'address': '123.123.123.123',
+ 'network': 'net-id-private'}, {
+ 'type': 'private',
+ 'address': '10.123.123.123',
+ 'network': 'net-id-private'}, {
+ 'type': 'public',
+ 'address': '15.123.123.123',
+ 'network': 'net-id-public'}]
+
self.orig_ip_regex = CONF.ip_regex
self.orig_black_list_regex = CONF.black_list_regex
@@ -78,8 +84,8 @@ class SimpleInstanceTest(trove_testtools.TestCase):
CONF.black_list_regex = '^10.123.123.*'
ip = self.instance.get_visible_ip_addresses()
self.assertEqual(2, len(ip))
- self.assertIn('123.123.123.123', ip)
- self.assertIn('15.123.123.123', ip)
+ self.assertIn('123.123.123.123', ip[0].get('address'))
+ self.assertIn('15.123.123.123', ip[1].get('address'))
def test_filter_ips_black_list(self):
CONF.ip_regex = '.*'
diff --git a/trove/tests/unittests/instance/test_instance_views.py b/trove/tests/unittests/instance/test_instance_views.py
index a05affd5..d47adbe3 100644
--- a/trove/tests/unittests/instance/test_instance_views.py
+++ b/trove/tests/unittests/instance/test_instance_views.py
@@ -13,12 +13,12 @@
# License for the specific language governing permissions and limitations
# under the License.
#
-from unittest.mock import MagicMock
-from unittest.mock import Mock
from trove.common import cfg
from trove.instance.views import InstanceDetailView
from trove.instance.views import InstanceView
from trove.tests.unittests import trove_testtools
+from unittest.mock import MagicMock
+from unittest.mock import Mock
CONF = cfg.CONF
@@ -27,9 +27,16 @@ class InstanceViewsTest(trove_testtools.TestCase):
def setUp(self):
super(InstanceViewsTest, self).setUp()
- self.addresses = {"private": [{"addr": "123.123.123.123"}],
- "internal": [{"addr": "10.123.123.123"}],
- "public": [{"addr": "15.123.123.123"}]}
+ self.addresses = [{
+ 'type': 'private',
+ 'address': '123.123.123.123',
+ 'network': 'net-id-private'}, {
+ 'type': 'private',
+ 'address': '10.123.123.123',
+ 'network': 'net-id-private'}, {
+ 'type': 'public',
+ 'address': '15.123.123.123',
+ 'network': 'net-id-public'}]
self.orig_ip_regex = CONF.ip_regex
def tearDown(self):
@@ -53,11 +60,12 @@ class InstanceDetailViewTest(trove_testtools.TestCase):
self.instance.datastore_version.manager = 'mysql'
self.instance.hostname = 'test.trove.com'
self.ip = "1.2.3.4"
- self.instance.addresses = {"private": [{"addr": self.ip}]}
+ self.instance.addresses = [
+ {"address": self.ip, 'type': 'private', 'network': 'net-id'}]
self.instance.volume_used = '3'
self.instance.root_password = 'iloveyou'
self.instance.get_visible_ip_addresses.return_value = [
- {'type': 'private', 'address': '1.2.3.4'}]
+ {'type': 'private', 'address': '1.2.3.4', 'network': 'net-id'}]
self.instance.slave_of_id = None
self.instance.slaves = []
self.instance.locality = 'affinity'
@@ -139,7 +147,7 @@ class InstanceDetailViewTest(trove_testtools.TestCase):
instance = MagicMock()
instance.hostname = None
instance.get_visible_ip_addresses.return_value = [
- {'address': '10.111.0.27', 'type': 'private'}
+ {'address': '10.111.0.27', 'type': 'private', 'network': 'net-id'}
]
instance.access = None
instance.slaves = []
@@ -150,8 +158,8 @@ class InstanceDetailViewTest(trove_testtools.TestCase):
self.assertFalse(data['access']['is_public'])
instance.get_visible_ip_addresses.return_value = [
- {'address': '10.111.0.27', 'type': 'private'},
- {'address': '172.30.5.107', 'type': 'public'}
+ {'address': '10.111.0.27', 'type': 'private', 'network': 'net-id'},
+ {'address': '172.30.5.107', 'type': 'public', 'network': 'net-id'}
]
view = InstanceDetailView(instance, self.req)