File tree Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Expand file tree Collapse file tree 3 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -239,6 +239,8 @@ function create_magnum_conf {
239
239
default_volume_type=$( iniget /etc/cinder/cinder.conf DEFAULT default_volume_type)
240
240
iniset $MAGNUM_CONF cinder default_docker_volume_type $default_volume_type
241
241
242
+ iniset $MAGNUM_CONF drivers enabled_beta_drivers $MAGNUM_BETA_DRIVERS
243
+
242
244
iniset $MAGNUM_CONF kubernetes keystone_auth_default_policy $MAGNUM_K8S_KEYSTONE_AUTH_DEFAULT_POLICY
243
245
244
246
write_uwsgi_config " $MAGNUM_UWSGI_CONF " " $MAGNUM_UWSGI " " /container-infra"
Original file line number Diff line number Diff line change 36
36
' Means if not specified, then all available drivers '
37
37
'are enabled.'
38
38
),
39
+ cfg .ListOpt ('enabled_beta_drivers' ,
40
+ default = [],
41
+ help = 'List of beta drivers to enable. Beta drivers are not '
42
+ ' intended for production. Defaults to []. '
43
+ ),
39
44
]
40
45
41
46
Original file line number Diff line number Diff line change 16
16
17
17
import importlib_metadata as metadata
18
18
from oslo_config import cfg
19
+ from oslo_log import log as logging
19
20
from stevedore import driver
20
21
from stevedore import exception as stevedore_exception
21
22
24
25
25
26
26
27
CONF = cfg .CONF
28
+ LOG = logging .getLogger (__name__ )
27
29
28
30
29
31
class Driver (object , metaclass = abc .ABCMeta ):
30
32
31
33
definitions = None
34
+ beta = False
32
35
33
36
@classmethod
34
37
def load_entry_points (cls ):
@@ -138,6 +141,17 @@ class Driver2(Driver):
138
141
os = os ,
139
142
coe = coe )
140
143
driver_info = definition_map [cluster_type ]
144
+ driver_name = driver_info ['entry_point_name' ]
145
+ beta = driver_info ['class' ].beta
146
+ if (beta and
147
+ driver_name not in CONF .drivers .enabled_beta_drivers ):
148
+ LOG .info (f"Driver { driver_name } is beta "
149
+ "and needs to be explicitly enabled with "
150
+ "[drivers]/enabled_beta_drivers." )
151
+ raise exception .ClusterTypeNotSupported (
152
+ server_type = server_type ,
153
+ os = os ,
154
+ coe = coe )
141
155
# TODO(muralia): once --drivername is supported as an input during
142
156
# cluster create, change the following line to use driver name for
143
157
# loading.
You can’t perform that action at this time.
0 commit comments