From 51f4256e79e2b43e2a385c5db20737fc932b7ffd Mon Sep 17 00:00:00 2001 From: Takashi Kajinami Date: Wed, 15 Mar 2023 11:52:40 +0900 Subject: [PATCH] Deprecate unused options of reserved store When I implemented support for reserved store options[1], I somehow overlooked the fact that some of the registered options are not really used. This is mainly because glance does not use 'add' API of the filesystem store but just write data directly into the store directory. This deprecates the ineffective options so that we can remove these in a future release. [1] d82df7aeddac0bdaaa2e687e5950ad9ccfa98001 Change-Id: Ifde7f70f4cf6a04e22e092a819e0c598079682ee --- manifests/backend/reserved/staging.pp | 37 +++++++++++++----- manifests/backend/reserved/tasks.pp | 39 +++++++++++++------ ...-reserved-store-opts-e9f0656c2850594a.yaml | 10 +++++ 3 files changed, 65 insertions(+), 21 deletions(-) create mode 100644 releasenotes/notes/deprecate-unused-reserved-store-opts-e9f0656c2850594a.yaml diff --git a/manifests/backend/reserved/staging.pp b/manifests/backend/reserved/staging.pp index 9a9294cf..bfa6b6df 100644 --- a/manifests/backend/reserved/staging.pp +++ b/manifests/backend/reserved/staging.pp @@ -23,29 +23,46 @@ # (optional) Directory where dist images are stored. # Defaults to $facts['os_service_default']. # -# [*filesystem_store_file_perm*] -# (optional) File access permissions for the image files. -# Defaults to $facts['os_service_default']. -# # [*filesystem_store_chunk_size*] # (optional) Chunk size, in bytes. # Defaults to $facts['os_service_default']. # +# DEPRECATED PARAMETERS +# +# [*filesystem_store_file_perm*] +# (optional) File access permissions for the image files. +# Defaults to $facts['os_service_default']. +# # [*filesystem_thin_provisioning*] # (optional) Boolean describing if thin provisioning is enabled or not # Defaults to $facts['os_service_default'] # class glance::backend::reserved::staging( $filesystem_store_datadir = $facts['os_service_default'], - $filesystem_store_file_perm = $facts['os_service_default'], $filesystem_store_chunk_size = $facts['os_service_default'], - $filesystem_thin_provisioning = $facts['os_service_default'], + # DEPRECATED PARAMETERS + $filesystem_store_file_perm = undef, + $filesystem_thin_provisioning = undef, ) { + if $filesystem_store_file_perm != undef { + warning("The filesystem_store_file_perm parameter has been deprecated and \ +will be removed in a future release") + } + + if $filesystem_thin_provisioning != undef { + warning("The filesystem_thin_provisioning parameter has been deprecated and \ +will be removed in a future release") + } + glance_api_config { - 'os_glance_staging_store/filesystem_store_datadir': value => $filesystem_store_datadir; - 'os_glance_staging_store/filesystem_store_file_perm': value => $filesystem_store_file_perm; - 'os_glance_staging_store/filesystem_store_chunk_size': value => $filesystem_store_chunk_size; - 'os_glance_staging_store/filesystem_thin_provisioning': value => $filesystem_thin_provisioning; + 'os_glance_staging_store/filesystem_store_datadir': + value => $filesystem_store_datadir; + 'os_glance_staging_store/filesystem_store_file_perm': + value => pick($filesystem_store_file_perm, $facts['os_service_default']); + 'os_glance_staging_store/filesystem_store_chunk_size': + value => $filesystem_store_chunk_size; + 'os_glance_staging_store/filesystem_thin_provisioning': + value => pick($filesystem_thin_provisioning, $facts['os_service_default']); } } diff --git a/manifests/backend/reserved/tasks.pp b/manifests/backend/reserved/tasks.pp index 2a210280..d958e038 100644 --- a/manifests/backend/reserved/tasks.pp +++ b/manifests/backend/reserved/tasks.pp @@ -23,29 +23,46 @@ # (optional) Directory where dist images are stored. # Defaults to $facts['os_service_default']. # -# [*filesystem_store_file_perm*] -# (optional) File access permissions for the image files. -# Defaults to $facts['os_service_default']. -# # [*filesystem_store_chunk_size*] # (optional) Chunk size, in bytes. # Defaults to $facts['os_service_default']. # +# DEPRECATED PARAMETERS +# +# [*filesystem_store_file_perm*] +# (optional) File access permissions for the image files. +# Defaults to undef. +# # [*filesystem_thin_provisioning*] # (optional) Boolean describing if thin provisioning is enabled or not -# Defaults to $facts['os_service_default'] +# Defaults to undef. # class glance::backend::reserved::tasks( $filesystem_store_datadir = $facts['os_service_default'], - $filesystem_store_file_perm = $facts['os_service_default'], $filesystem_store_chunk_size = $facts['os_service_default'], - $filesystem_thin_provisioning = $facts['os_service_default'], + # DEPRECATED PARAMETERS + $filesystem_store_file_perm = undef, + $filesystem_thin_provisioning = undef, ) { + if $filesystem_store_file_perm != undef { + warning("The filesystem_store_file_perm parameter has been deprecated and \ +will be removed in a future release") + } + + if $filesystem_thin_provisioning != undef { + warning("The filesystem_thin_provisioning parameter has been deprecated and \ +will be removed in a future release") + } + glance_api_config { - 'os_glance_tasks_store/filesystem_store_datadir': value => $filesystem_store_datadir; - 'os_glance_tasks_store/filesystem_store_file_perm': value => $filesystem_store_file_perm; - 'os_glance_tasks_store/filesystem_store_chunk_size': value => $filesystem_store_chunk_size; - 'os_glance_tasks_store/filesystem_thin_provisioning': value => $filesystem_thin_provisioning; + 'os_glance_tasks_store/filesystem_store_datadir': + value => $filesystem_store_datadir; + 'os_glance_tasks_store/filesystem_store_file_perm': + value => pick($filesystem_store_file_perm, $facts['os_service_default']); + 'os_glance_tasks_store/filesystem_store_chunk_size': + value => $filesystem_store_chunk_size; + 'os_glance_tasks_store/filesystem_thin_provisioning': + value => pick($filesystem_thin_provisioning, $facts['os_service_default']); } } diff --git a/releasenotes/notes/deprecate-unused-reserved-store-opts-e9f0656c2850594a.yaml b/releasenotes/notes/deprecate-unused-reserved-store-opts-e9f0656c2850594a.yaml new file mode 100644 index 00000000..c1c95951 --- /dev/null +++ b/releasenotes/notes/deprecate-unused-reserved-store-opts-e9f0656c2850594a.yaml @@ -0,0 +1,10 @@ +--- +deprecations: + - | + The following parmeters were deprecated and will be removed in a future + release. + + - ``glance::backend::reserved::staging::filesystem_store_file_perm`` + - ``glance::backend::reserved::staging::filesystem_thin_provisioning`` + - ``glance::backend::reserved::tasks::filesystem_store_file_perm`` + - ``glance::backend::reserved::tasks::filesystem_thin_provisioning``