summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRicardo Rocha <rocha.porto@gmail.com>2017-10-10 13:17:51 +0000
committerRicardo Rocha <rocha.porto@gmail.com>2017-12-14 14:41:09 +0000
commit28fff8006ae17d9afeee4ad409e12b6608fa26cb (patch)
tree33d9c24d35b012520748d4292a7ea1eb59a499c4
parent46b265ed47db7609513b454b0b12f22d0e48069f (diff)
Make docker_storage_driver a str instead of enum
Allow any value to be passed on the docker_storage_driver field by turning it into a StringField (was EnumField), and remove the constraints limiting the values to 'devicemapper' and 'overlay'. Change the docker storage setup to have a generic setup for all drivers with the exception of 'devicemapper', which keeps its own specific storage config function. For all others, do the same we already did for overlay (with two cases for usage of a cinder volume or not) and simply set the storage driver in the docker configuration to the value provided in the cluster template. Change-Id: I9aa8f232ce64ece4d439c0a476f463820a499617 Closes-Bug: #1722522
Notes
Notes (review): Code-Review+2: Spyros Trigazis (strigazi) <strigazi@gmail.com> Code-Review+2: yatin <ykarel@redhat.com> Workflow+1: yatin <ykarel@redhat.com> Verified+2: Zuul Submitted-by: Zuul Submitted-at: Fri, 15 Dec 2017 06:04:16 +0000 Reviewed-on: https://review.openstack.org/510882 Project: openstack/magnum Branch: refs/heads/master
-rw-r--r--api-ref/source/parameters.yaml3
-rw-r--r--doc/source/user/index.rst9
-rw-r--r--magnum/api/controllers/v1/baymodel.py2
-rw-r--r--magnum/api/controllers/v1/cluster_template.py2
-rw-r--r--magnum/db/sqlalchemy/alembic/versions/04c625aa95ba_change_storage_driver_to_string.py33
-rw-r--r--magnum/drivers/common/templates/fragments/configure-docker-storage.sh12
-rw-r--r--magnum/drivers/common/templates/fragments/configure_docker_storage_driver_atomic.sh10
-rw-r--r--magnum/drivers/k8s_fedora_atomic_v1/templates/kubecluster.yaml2
-rw-r--r--magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml2
-rw-r--r--magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml2
-rw-r--r--magnum/drivers/k8s_fedora_ironic_v1/templates/kubecluster.yaml2
-rw-r--r--magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml2
-rw-r--r--magnum/drivers/k8s_fedora_ironic_v1/templates/kubeminion_software_configs.yaml2
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v1/templates/cluster.yaml2
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml2
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml2
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v2/templates/swarmcluster.yaml2
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v2/templates/swarmmaster.yaml2
-rw-r--r--magnum/drivers/swarm_fedora_atomic_v2/templates/swarmnode.yaml2
-rw-r--r--magnum/objects/cluster_template.py6
-rw-r--r--magnum/objects/fields.py16
-rw-r--r--magnum/tests/unit/objects/test_objects.py2
-rw-r--r--releasenotes/notes/bug-1722522-d94743c6362a5e48.yaml10
23 files changed, 60 insertions, 69 deletions
diff --git a/api-ref/source/parameters.yaml b/api-ref/source/parameters.yaml
index 0d57506..d8d413a 100644
--- a/api-ref/source/parameters.yaml
+++ b/api-ref/source/parameters.yaml
@@ -225,8 +225,7 @@ dns_nameserver:
225docker_storage_driver: 225docker_storage_driver:
226 description: | 226 description: |
227 The name of a driver to manage the storage for the images and the 227 The name of a driver to manage the storage for the images and the
228 container's writable layer. The supported drivers are ``devicemapper`` and 228 container's writable layer. The default is ``devicemapper``.
229 ``overlay``. The default is ``devicemapper``.
230 in: body 229 in: body
231 required: true 230 required: true
232 type: string 231 type: string
diff --git a/doc/source/user/index.rst b/doc/source/user/index.rst
index 32dd190..f6c97d9 100644
--- a/doc/source/user/index.rst
+++ b/doc/source/user/index.rst
@@ -236,8 +236,7 @@ They are loosely grouped as: mandatory, infrastructure, COE specific.
236 236
237--docker-storage-driver \<docker-storage-driver\> 237--docker-storage-driver \<docker-storage-driver\>
238 The name of a driver to manage the storage for the images and the 238 The name of a driver to manage the storage for the images and the
239 container's writable layer. The supported drivers are 'devicemapper' 239 container's writable layer. The default is 'devicemapper'.
240 and 'overlay'. The default is 'devicemapper'.
241 240
242--labels \<KEY1=VALUE1,KEY2=VALUE2;KEY3=VALUE3...\> 241--labels \<KEY1=VALUE1,KEY2=VALUE2;KEY3=VALUE3...\>
243 Arbitrary labels in the form of key=value pairs. The accepted keys 242 Arbitrary labels in the form of key=value pairs. The accepted keys
@@ -1025,8 +1024,7 @@ Volume driver (volume-driver)
1025 1024
1026Storage driver (docker-storage-driver) 1025Storage driver (docker-storage-driver)
1027 Specified in the ClusterTemplate to select the Docker storage driver. The 1026 Specified in the ClusterTemplate to select the Docker storage driver. The
1028 supported storage drivers are 'devicemapper' and 'overlay', with 1027 default is 'devicemapper'. Refer to the `Storage`_ section for more
1029 'devicemapper' being the default. Refer to the `Storage`_ section for more
1030 details. 1028 details.
1031 1029
1032Image (image) 1030Image (image)
@@ -1203,8 +1201,7 @@ Volume driver (volume-driver)
1203 1201
1204Storage driver (docker-storage-driver) 1202Storage driver (docker-storage-driver)
1205 Specified in the ClusterTemplate to select the Docker storage driver. The 1203 Specified in the ClusterTemplate to select the Docker storage driver. The
1206 supported storage driver are 'devicemapper' and 'overlay', with 1204 default is 'devicemapper'. Refer to the `Storage`_ section for more
1207 'devicemapper' being the default. Refer to the `Storage`_ section for more
1208 details. 1205 details.
1209 1206
1210Image (image) 1207Image (image)
diff --git a/magnum/api/controllers/v1/baymodel.py b/magnum/api/controllers/v1/baymodel.py
index fb9b268..1b5c0e6 100644
--- a/magnum/api/controllers/v1/baymodel.py
+++ b/magnum/api/controllers/v1/baymodel.py
@@ -127,7 +127,7 @@ class BayModel(base.APIBase):
127 insecure_registry = wtypes.StringType(min_length=1, max_length=255) 127 insecure_registry = wtypes.StringType(min_length=1, max_length=255)
128 """Insecure registry URL when creating a Baymodel""" 128 """Insecure registry URL when creating a Baymodel"""
129 129
130 docker_storage_driver = wtypes.Enum(str, *fields.DockerStorageDriver.ALL) 130 docker_storage_driver = wtypes.StringType(min_length=1, max_length=255)
131 """Docker storage driver""" 131 """Docker storage driver"""
132 132
133 master_lb_enabled = wsme.wsattr(types.boolean, default=False) 133 master_lb_enabled = wsme.wsattr(types.boolean, default=False)
diff --git a/magnum/api/controllers/v1/cluster_template.py b/magnum/api/controllers/v1/cluster_template.py
index cc95bfc..fe0d942 100644
--- a/magnum/api/controllers/v1/cluster_template.py
+++ b/magnum/api/controllers/v1/cluster_template.py
@@ -128,7 +128,7 @@ class ClusterTemplate(base.APIBase):
128 insecure_registry = wtypes.StringType(min_length=1, max_length=255) 128 insecure_registry = wtypes.StringType(min_length=1, max_length=255)
129 """Insecure registry URL when creating a ClusterTemplate """ 129 """Insecure registry URL when creating a ClusterTemplate """
130 130
131 docker_storage_driver = wtypes.Enum(str, *fields.DockerStorageDriver.ALL) 131 docker_storage_driver = wtypes.StringType(min_length=1, max_length=255)
132 """Docker storage driver""" 132 """Docker storage driver"""
133 133
134 master_lb_enabled = wsme.wsattr(types.boolean, default=False) 134 master_lb_enabled = wsme.wsattr(types.boolean, default=False)
diff --git a/magnum/db/sqlalchemy/alembic/versions/04c625aa95ba_change_storage_driver_to_string.py b/magnum/db/sqlalchemy/alembic/versions/04c625aa95ba_change_storage_driver_to_string.py
new file mode 100644
index 0000000..4a53f32
--- /dev/null
+++ b/magnum/db/sqlalchemy/alembic/versions/04c625aa95ba_change_storage_driver_to_string.py
@@ -0,0 +1,33 @@
1# Licensed under the Apache License, Version 2.0 (the "License"); you may
2# not use this file except in compliance with the License. You may obtain
3# a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
9# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
10# License for the specific language governing permissions and limitations
11# under the License.
12"""change storage driver to string
13
14Revision ID: 04c625aa95ba
15Revises: 52bcaf58fecb
16Create Date: 2017-10-10 15:40:37.553288
17
18"""
19
20# revision identifiers, used by Alembic.
21revision = '04c625aa95ba'
22down_revision = '52bcaf58fecb'
23
24from alembic import op
25import sqlalchemy as sa
26
27
28def upgrade():
29 op.alter_column('cluster_template', 'docker_storage_driver',
30 existing_type=sa.Enum('devicemapper', 'overlay',
31 name='docker_storage_driver'),
32 type_=sa.String(length=512),
33 nullable=True)
diff --git a/magnum/drivers/common/templates/fragments/configure-docker-storage.sh b/magnum/drivers/common/templates/fragments/configure-docker-storage.sh
index 4704e07..87b8038 100644
--- a/magnum/drivers/common/templates/fragments/configure-docker-storage.sh
+++ b/magnum/drivers/common/templates/fragments/configure-docker-storage.sh
@@ -32,14 +32,8 @@ fi
32 32
33$configure_docker_storage_driver 33$configure_docker_storage_driver
34 34
35if [ "$DOCKER_STORAGE_DRIVER" = "overlay" ]; then 35if [ "$DOCKER_STORAGE_DRIVER" = "devicemapper" ]; then
36 if [ $(echo -e "$(uname -r)\n3.18" | sort -V | head -1) = $(uname -r) ]; then
37 ERROR_MESSAGE="OverlayFS requires at least Linux kernel 3.18. Cluster node kernel version: $(uname -r)"
38 echo "ERROR: ${ERROR_MESSAGE}" >&2
39 sh -c "${WAIT_CURL} --data-binary '{\"status\": \"FAILURE\", \"reason\": \"${ERROR_MESSAGE}\"}'"
40 else
41 configure_overlay
42 fi
43else
44 configure_devicemapper 36 configure_devicemapper
37else
38 configure_storage_driver_generic $DOCKER_STORAGE_DRIVER
45fi 39fi
diff --git a/magnum/drivers/common/templates/fragments/configure_docker_storage_driver_atomic.sh b/magnum/drivers/common/templates/fragments/configure_docker_storage_driver_atomic.sh
index 9d92a66..a06cccc 100644
--- a/magnum/drivers/common/templates/fragments/configure_docker_storage_driver_atomic.sh
+++ b/magnum/drivers/common/templates/fragments/configure_docker_storage_driver_atomic.sh
@@ -1,5 +1,5 @@
1# This file contains docker storage drivers configuration for fedora 1# This file contains docker storage drivers configuration for fedora
2# atomic hosts. Currently, devicemapper and overlay are supported. 2# atomic hosts, as supported by Magnum.
3 3
4# * Remove any existing docker-storage configuration. In case of an 4# * Remove any existing docker-storage configuration. In case of an
5# existing configuration, docker-storage-setup will fail. 5# existing configuration, docker-storage-setup will fail.
@@ -17,8 +17,8 @@ clear_docker_storage () {
17 fi 17 fi
18} 18}
19 19
20# Configure docker storage with xfs as backing filesystem. 20# Configure generic docker storage driver.
21configure_overlay () { 21configure_storage_driver_generic() {
22 clear_docker_storage 22 clear_docker_storage
23 23
24 if [ -n "$DOCKER_VOLUME_SIZE" ] && [ "$DOCKER_VOLUME_SIZE" -gt 0 ]; then 24 if [ -n "$DOCKER_VOLUME_SIZE" ] && [ "$DOCKER_VOLUME_SIZE" -gt 0 ]; then
@@ -27,9 +27,7 @@ configure_overlay () {
27 mount -a 27 mount -a
28 fi 28 fi
29 29
30 echo "STORAGE_DRIVER=overlay" > /etc/sysconfig/docker-storage-setup 30 sed -i "/^DOCKER_STORAGE_OPTIONS=/ s/=.*/=-s $1/" /etc/sysconfig/docker-storage
31
32 docker-storage-setup
33 31
34 local lvname=$(lvdisplay | grep "LV\ Path" | awk '{print $3}') 32 local lvname=$(lvdisplay | grep "LV\ Path" | awk '{print $3}')
35 local pvname=$(pvdisplay | grep "PV\ Name" | awk '{print $3}') 33 local pvname=$(pvdisplay | grep "PV\ Name" | awk '{print $3}')
diff --git a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubecluster.yaml b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubecluster.yaml
index 8a05721..a87183b 100644
--- a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubecluster.yaml
+++ b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubecluster.yaml
@@ -153,8 +153,6 @@ parameters:
153 type: string 153 type: string
154 description: docker storage driver name 154 description: docker storage driver name
155 default: "devicemapper" 155 default: "devicemapper"
156 constraints:
157 - allowed_values: ["devicemapper", "overlay"]
158 156
159 wait_condition_timeout: 157 wait_condition_timeout:
160 type: number 158 type: number
diff --git a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml
index 6bdc0ac..335fae7 100644
--- a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml
+++ b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubemaster.yaml
@@ -60,8 +60,6 @@ parameters:
60 type: string 60 type: string
61 description: docker storage driver name 61 description: docker storage driver name
62 default: "devicemapper" 62 default: "devicemapper"
63 constraints:
64 - allowed_values: ["devicemapper", "overlay"]
65 63
66 volume_driver: 64 volume_driver:
67 type: string 65 type: string
diff --git a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml
index 53ef59d..d299fbe 100644
--- a/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml
+++ b/magnum/drivers/k8s_fedora_atomic_v1/templates/kubeminion.yaml
@@ -50,8 +50,6 @@ parameters:
50 type: string 50 type: string
51 description: docker storage driver name 51 description: docker storage driver name
52 default: "devicemapper" 52 default: "devicemapper"
53 constraints:
54 - allowed_values: ["devicemapper", "overlay"]
55 53
56 tls_disabled: 54 tls_disabled:
57 type: boolean 55 type: boolean
diff --git a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubecluster.yaml b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubecluster.yaml
index 0225633..7368159 100644
--- a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubecluster.yaml
+++ b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubecluster.yaml
@@ -151,8 +151,6 @@ parameters:
151 type: string 151 type: string
152 description: docker storage driver name 152 description: docker storage driver name
153 default: "devicemapper" 153 default: "devicemapper"
154 constraints:
155 - allowed_values: ["devicemapper", "overlay"]
156 154
157 wait_condition_timeout: 155 wait_condition_timeout:
158 type: number 156 type: number
diff --git a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml
index 43b987d..e496523 100644
--- a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml
+++ b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubemaster.yaml
@@ -49,8 +49,6 @@ parameters:
49 type: string 49 type: string
50 description: docker storage driver name 50 description: docker storage driver name
51 default: "devicemapper" 51 default: "devicemapper"
52 constraints:
53 - allowed_values: ["devicemapper", "overlay"]
54 52
55 flannel_network_cidr: 53 flannel_network_cidr:
56 type: string 54 type: string
diff --git a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubeminion_software_configs.yaml b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubeminion_software_configs.yaml
index 0c7bd45..8b7d006 100644
--- a/magnum/drivers/k8s_fedora_ironic_v1/templates/kubeminion_software_configs.yaml
+++ b/magnum/drivers/k8s_fedora_ironic_v1/templates/kubeminion_software_configs.yaml
@@ -22,8 +22,6 @@ parameters:
22 type: string 22 type: string
23 description: docker storage driver name 23 description: docker storage driver name
24 default: "devicemapper" 24 default: "devicemapper"
25 constraints:
26 - allowed_values: ["devicemapper", "overlay"]
27 25
28 tls_disabled: 26 tls_disabled:
29 type: boolean 27 type: boolean
diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/cluster.yaml b/magnum/drivers/swarm_fedora_atomic_v1/templates/cluster.yaml
index aacafda..103e8ef 100644
--- a/magnum/drivers/swarm_fedora_atomic_v1/templates/cluster.yaml
+++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/cluster.yaml
@@ -144,8 +144,6 @@ parameters:
144 type: string 144 type: string
145 description: docker storage driver name 145 description: docker storage driver name
146 default: "devicemapper" 146 default: "devicemapper"
147 constraints:
148 - allowed_values: ["devicemapper", "overlay"]
149 147
150 loadbalancing_protocol: 148 loadbalancing_protocol:
151 type: string 149 type: string
diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml
index c535676..a8f0407 100644
--- a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml
+++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmmaster.yaml
@@ -29,8 +29,6 @@ parameters:
29 docker_storage_driver: 29 docker_storage_driver:
30 type: string 30 type: string
31 description: docker storage driver name 31 description: docker storage driver name
32 constraints:
33 - allowed_values: ["devicemapper", "overlay"]
34 32
35 external_network: 33 external_network:
36 type: string 34 type: string
diff --git a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml
index d4562e1..3d4dd64 100644
--- a/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml
+++ b/magnum/drivers/swarm_fedora_atomic_v1/templates/swarmnode.yaml
@@ -38,8 +38,6 @@ parameters:
38 docker_storage_driver: 38 docker_storage_driver:
39 type: string 39 type: string
40 description: docker storage driver name 40 description: docker storage driver name
41 constraints:
42 - allowed_values: ["devicemapper", "overlay"]
43 41
44 external_network: 42 external_network:
45 type: string 43 type: string
diff --git a/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmcluster.yaml b/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmcluster.yaml
index 9687836..55de329 100644
--- a/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmcluster.yaml
+++ b/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmcluster.yaml
@@ -116,8 +116,6 @@ parameters:
116 type: string 116 type: string
117 description: docker storage driver name 117 description: docker storage driver name
118 default: "devicemapper" 118 default: "devicemapper"
119 constraints:
120 - allowed_values: ["devicemapper", "overlay"]
121 119
122 loadbalancing_protocol: 120 loadbalancing_protocol:
123 type: string 121 type: string
diff --git a/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmmaster.yaml b/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmmaster.yaml
index 8f8d6ff..cd7e675 100644
--- a/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmmaster.yaml
+++ b/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmmaster.yaml
@@ -30,8 +30,6 @@ parameters:
30 docker_storage_driver: 30 docker_storage_driver:
31 type: string 31 type: string
32 description: docker storage driver name 32 description: docker storage driver name
33 constraints:
34 - allowed_values: ["devicemapper", "overlay"]
35 33
36 external_network: 34 external_network:
37 type: string 35 type: string
diff --git a/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmnode.yaml b/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmnode.yaml
index c0c362a..a205833 100644
--- a/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmnode.yaml
+++ b/magnum/drivers/swarm_fedora_atomic_v2/templates/swarmnode.yaml
@@ -38,8 +38,6 @@ parameters:
38 docker_storage_driver: 38 docker_storage_driver:
39 type: string 39 type: string
40 description: docker storage driver name 40 description: docker storage driver name
41 constraints:
42 - allowed_values: ["devicemapper", "overlay"]
43 41
44 external_network: 42 external_network:
45 type: string 43 type: string
diff --git a/magnum/objects/cluster_template.py b/magnum/objects/cluster_template.py
index ecaff18..955536d 100644
--- a/magnum/objects/cluster_template.py
+++ b/magnum/objects/cluster_template.py
@@ -41,7 +41,8 @@ class ClusterTemplate(base.MagnumPersistentObject, base.MagnumObject,
41 # Version 1.15: Added 'floating_ip_enabled' field 41 # Version 1.15: Added 'floating_ip_enabled' field
42 # Version 1.16: Renamed the class from "BayModel' to 'ClusterTemplate' 42 # Version 1.16: Renamed the class from "BayModel' to 'ClusterTemplate'
43 # Version 1.17: 'coe' field type change to ClusterTypeField 43 # Version 1.17: 'coe' field type change to ClusterTypeField
44 VERSION = '1.17' 44 # Version 1.18: DockerStorageDriver is a StringField (was an Enum)
45 VERSION = '1.18'
45 46
46 dbapi = dbapi.get_instance() 47 dbapi = dbapi.get_instance()
47 48
@@ -63,8 +64,7 @@ class ClusterTemplate(base.MagnumPersistentObject, base.MagnumObject,
63 'volume_driver': fields.StringField(nullable=True), 64 'volume_driver': fields.StringField(nullable=True),
64 'apiserver_port': fields.IntegerField(nullable=True), 65 'apiserver_port': fields.IntegerField(nullable=True),
65 'docker_volume_size': fields.IntegerField(nullable=True), 66 'docker_volume_size': fields.IntegerField(nullable=True),
66 'docker_storage_driver': m_fields.DockerStorageDriverField( 67 'docker_storage_driver': fields.StringField(nullable=True),
67 nullable=True),
68 'cluster_distro': fields.StringField(nullable=True), 68 'cluster_distro': fields.StringField(nullable=True),
69 'coe': m_fields.ClusterTypeField(nullable=True), 69 'coe': m_fields.ClusterTypeField(nullable=True),
70 'http_proxy': fields.StringField(nullable=True), 70 'http_proxy': fields.StringField(nullable=True),
diff --git a/magnum/objects/fields.py b/magnum/objects/fields.py
index 559a4e8..9024ef3 100644
--- a/magnum/objects/fields.py
+++ b/magnum/objects/fields.py
@@ -72,18 +72,6 @@ class ClusterType(fields.Enum):
72 super(ClusterType, self).__init__(valid_values=ClusterType.ALL) 72 super(ClusterType, self).__init__(valid_values=ClusterType.ALL)
73 73
74 74
75class DockerStorageDriver(fields.Enum):
76 ALL = (
77 DEVICEMAPPER, OVERLAY,
78 ) = (
79 'devicemapper', 'overlay',
80 )
81
82 def __init__(self):
83 super(DockerStorageDriver, self).__init__(
84 valid_values=DockerStorageDriver.ALL)
85
86
87class QuotaResourceName(fields.Enum): 75class QuotaResourceName(fields.Enum):
88 ALL = ( 76 ALL = (
89 CLUSTER, 77 CLUSTER,
@@ -156,9 +144,5 @@ class ClusterTypeField(fields.BaseEnumField):
156 AUTO_TYPE = ClusterType() 144 AUTO_TYPE = ClusterType()
157 145
158 146
159class DockerStorageDriverField(fields.BaseEnumField):
160 AUTO_TYPE = DockerStorageDriver()
161
162
163class ServerTypeField(fields.BaseEnumField): 147class ServerTypeField(fields.BaseEnumField):
164 AUTO_TYPE = ServerType() 148 AUTO_TYPE = ServerType()
diff --git a/magnum/tests/unit/objects/test_objects.py b/magnum/tests/unit/objects/test_objects.py
index 0f9c3de..16d1f5c 100644
--- a/magnum/tests/unit/objects/test_objects.py
+++ b/magnum/tests/unit/objects/test_objects.py
@@ -356,7 +356,7 @@ class TestObject(test_base.TestCase, _TestObject):
356# http://docs.openstack.org/developer/magnum/objects.html 356# http://docs.openstack.org/developer/magnum/objects.html
357object_data = { 357object_data = {
358 'Cluster': '1.16-7a544c5059697c464810470980f81ba1', 358 'Cluster': '1.16-7a544c5059697c464810470980f81ba1',
359 'ClusterTemplate': '1.17-f1ce5212b46506360b41ab5cb7658af4', 359 'ClusterTemplate': '1.18-7fa94f4fdd027acfb4f022f202afdfb5',
360 'Certificate': '1.1-1924dc077daa844f0f9076332ef96815', 360 'Certificate': '1.1-1924dc077daa844f0f9076332ef96815',
361 'MyObj': '1.0-34c4b1aadefd177b13f9a2f894cc23cd', 361 'MyObj': '1.0-34c4b1aadefd177b13f9a2f894cc23cd',
362 'X509KeyPair': '1.2-d81950af36c59a71365e33ce539d24f9', 362 'X509KeyPair': '1.2-d81950af36c59a71365e33ce539d24f9',
diff --git a/releasenotes/notes/bug-1722522-d94743c6362a5e48.yaml b/releasenotes/notes/bug-1722522-d94743c6362a5e48.yaml
new file mode 100644
index 0000000..b4164ff
--- /dev/null
+++ b/releasenotes/notes/bug-1722522-d94743c6362a5e48.yaml
@@ -0,0 +1,10 @@
1---
2features:
3 - |
4 Allow any value to be passed on the docker_storage_driver field by turning it
5 into a StringField (was EnumField), and remove the constraints limiting the
6 values to 'devicemapper' and 'overlay'.
7upgrade:
8 - |
9 Requires a db upgrade to change the docker_storage_driver
10 field to be a string instead of an enum.