Skip to content

Commit 9871cfe

Browse files
rodrigogansobarbieripriteau
authored andcommitted
Fix "signature_verified" metadata propagation to images
The property "signature_verified" is added by cinder to volumes created from images. That property is propagated to glance when images are created from such volumes. Later, when creating volumes from such images again, the image property conflicts with cinder trying to add the property again. The solution is to never propagate such cinder property in the first place. Closes-bug: #1823445 Change-Id: Id46877e490b17c00ba1cf8cf312dd2f456760a23 (cherry picked from commit c65f43c) (cherry picked from commit 9dbf296) (cherry picked from commit 9d1b6b8) (cherry picked from commit a770f72) (cherry picked from commit ae2d250)
1 parent 0e7ce34 commit 9871cfe

File tree

3 files changed

+17
-6
lines changed

3 files changed

+17
-6
lines changed

cinder/image/image_utils.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@
104104
'an operator has configured glance property protections '
105105
'to make some image properties read-only. Cinder will '
106106
'*always* filter out image metadata in the namespaces '
107-
'`os_glance` and `img_signature`; this configuration '
108-
'option allows operators to specify *additional* '
109-
'namespaces to be excluded.',
107+
'`os_glance`, `img_signature` and `signature_verified`; '
108+
'this configuration option allows operators to specify '
109+
'*additional* namespaces to be excluded.',
110110
default=[]),
111111
]
112112

@@ -132,7 +132,8 @@
132132

133133
COMPRESSIBLE_IMAGE_FORMATS = ('qcow2',)
134134

135-
GLANCE_RESERVED_NAMESPACES = ["os_glance", "img_signature"]
135+
GLANCE_RESERVED_NAMESPACES = ["os_glance", "img_signature",
136+
"signature_verified"]
136137

137138

138139
def validate_stores_id(context: context.RequestContext,

cinder/tests/unit/test_image_utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2704,7 +2704,7 @@ def test_filter_out_reserved_namespaces_metadata_with_empty_metadata(self):
27042704
@ddt.unpack
27052705
def test_filter_out_reserved_namespaces_metadata(
27062706
self, metadata_for_test, config, keys_to_pop):
2707-
hardcoded_keys = ['os_glance', "img_signature"]
2707+
hardcoded_keys = image_utils.GLANCE_RESERVED_NAMESPACES
27082708

27092709
keys_to_pop = hardcoded_keys + keys_to_pop
27102710

@@ -2764,7 +2764,7 @@ def test_filter_out_reserved_namespaces_metadata(
27642764
@ddt.unpack
27652765
def test_filter_out_reserved_namespaces_metadata_properties(
27662766
self, metadata_for_test, config, keys_to_pop):
2767-
hardcoded_keys = ['os_glance', "img_signature"]
2767+
hardcoded_keys = image_utils.GLANCE_RESERVED_NAMESPACES
27682768

27692769
keys_to_pop = hardcoded_keys + keys_to_pop
27702770

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed the volume property `signature_verified` propagating to images created
5+
from volumes. That property could later conflict with the same property being
6+
added again when creating a new volume from such image, preventing the volume
7+
from being created successfully. This volume property is created whenever a
8+
volume is created from an image for the purpose of indicating that the image
9+
signature was verified on creation, and was not intended to be propagated
10+
further if a new image is created from such volume.

0 commit comments

Comments
 (0)