From 1b26796802919f3cbc5350905c173397cf069417 Mon Sep 17 00:00:00 2001 From: Giulio Fidente Date: Fri, 15 May 2020 18:54:52 +0200 Subject: [PATCH] Make user value for GlanceImageImportPlugin prevail on logic We used to *append* image_conversion to the list of enabled Glance import plugins when both Glance and Nova were configured to use RBD but we should instead make user input prevail on the logic, assuming users who customize the THT param know what they are doing and eventually include image_conversion only when they need it. Change-Id: I5c0788bb361323f5a0e69e22d4bd42fa3c1e06ed (cherry picked from commit fe4253102a3ae73b125c75c9f4c51d82ddad7bbb) --- deployment/glance/glance-api-container-puppet.yaml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/deployment/glance/glance-api-container-puppet.yaml b/deployment/glance/glance-api-container-puppet.yaml index 54da7dfe76..b67dd2893b 100644 --- a/deployment/glance/glance-api-container-puppet.yaml +++ b/deployment/glance/glance-api-container-puppet.yaml @@ -135,8 +135,11 @@ parameters: Whether to show multiple image locations e.g for copy-on-write support on RBD or Netapp backends. Potential security risk, see glance.conf for more information. type: boolean + # We default import plugins list to 'no_op' (instead of empty list) to discern from the scenario + # in which the user purposely disabled all plugins setting it to an empty list. This is useful + # to automatically enable image_conversion plugin only when value is left to the default. GlanceImageImportPlugins: - default: [] + default: ['no_op'] description: > List of enabled Image Import Plugins. Valid values in the list are 'image_conversion', 'inject_metadata', 'no_op'. @@ -301,9 +304,10 @@ conditions: expression: $.data.values().any($.get("GlanceBackend", "") = "rbd") data: {get_param: GlanceMultistoreConfig} - true - enable_image_conversion: + force_image_conversion_plugin: and: - rbd_backend_enabled + - equals: [{get_param: GlanceImageImportPlugins}, ['no_op']] - equals: [{get_param: NovaEnableRbdBackend}, true] use_tls_proxy: {equals : [{get_param: EnableInternalTLS}, true]} glance_workers_unset: {equals : [{get_param: GlanceWorkers}, '']} @@ -409,7 +413,7 @@ outputs: glance::api::node_staging_uri: {get_param: GlanceNodeStagingUri} glance::api::image_import_plugins: if: - - enable_image_conversion + - force_image_conversion_plugin - list_concat_unique: - {get_param: GlanceImageImportPlugins} - ['image_conversion']