Set db_auto_create default to False

Change the default value for the db_auto_create option to False. This is
vital as the flag is managing upgrades as well if the databases already
exist.

It will prevent production deployments from having their databases
impacted if an API daemon is started for any reason pointing to
a production database.

Change-Id: Id7eac78737af76afe628deeca7c15c2ac969d47e
This commit is contained in:
Ricardo Rocha 2019-10-10 10:00:48 +02:00 committed by Douglas Mendizábal
parent 59985e4789
commit 6642a60830
4 changed files with 13 additions and 11 deletions

View File

@ -89,7 +89,7 @@ db_opts = [
cfg.IntOpt('sql_retry_interval', default=1,
help=u._("Interval between retries of opening a SQL "
"connection.")),
cfg.BoolOpt('db_auto_create', default=True,
cfg.BoolOpt('db_auto_create', default=False,
help=u._("Create the Barbican database on service startup.")),
cfg.IntOpt('max_limit_paging', default=100,
help=u._("Maximum page size for the 'limit' paging URL "

View File

@ -12,10 +12,6 @@ Database migrations can be optionally enabled during the API startup process.
Corollaries for this are that a new deployment should begin with only one node
to avoid migration race conditions.
Alternatively, the automatic update startup behavior can be disabled, forcing
the use of the migration script. This latter mode is probably safer to use in
production environments.
Policy
-------

View File

@ -51,12 +51,10 @@
#. Populate the Key Manager service database:
The Key Manager service database will be automatically populated
when the service is first started. To prevent this, and run the
database sync manually, edit the ``/etc/barbican/barbican.conf`` file
and set db_auto_create in the ``[DEFAULT]`` section to False.
Then populate the database as below:
If you wish the Key Manager service to automatically populate the
database when the service is first started, set db_auto_create to
True in the ``[DEFAULT]`` section. By default this will not be active
and you can populate the database manually as below:
.. code-block:: console

View File

@ -0,0 +1,8 @@
---
upgrade:
- |
Default for auto_db_create has been changed to False (was True). This is a
change compared to the previous behavior, but required to protect
production deployments from performing upgrades without control. If you
wish to keep the auto db creation/upgrade behavior, change this to True
in your configuration.