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 {
239239 default_volume_type=$( iniget /etc/cinder/cinder.conf DEFAULT default_volume_type)
240240 iniset $MAGNUM_CONF cinder default_docker_volume_type $default_volume_type
241241
242+ iniset $MAGNUM_CONF drivers enabled_beta_drivers $MAGNUM_BETA_DRIVERS
243+
242244 iniset $MAGNUM_CONF kubernetes keystone_auth_default_policy $MAGNUM_K8S_KEYSTONE_AUTH_DEFAULT_POLICY
243245
244246 write_uwsgi_config " $MAGNUM_UWSGI_CONF " " $MAGNUM_UWSGI " " /container-infra"
Original file line number Diff line number Diff line change 3636 ' Means if not specified, then all available drivers '
3737 'are enabled.'
3838 ),
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+ ),
3944]
4045
4146
Original file line number Diff line number Diff line change 1616
1717import importlib_metadata as metadata
1818from oslo_config import cfg
19+ from oslo_log import log as logging
1920from stevedore import driver
2021from stevedore import exception as stevedore_exception
2122
2425
2526
2627CONF = cfg .CONF
28+ LOG = logging .getLogger (__name__ )
2729
2830
2931class Driver (object , metaclass = abc .ABCMeta ):
3032
3133 definitions = None
34+ beta = False
3235
3336 @classmethod
3437 def load_entry_points (cls ):
@@ -138,6 +141,17 @@ class Driver2(Driver):
138141 os = os ,
139142 coe = coe )
140143 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 )
141155 # TODO(muralia): once --drivername is supported as an input during
142156 # cluster create, change the following line to use driver name for
143157 # loading.
You can’t perform that action at this time.
0 commit comments