Skip to content

Commit 1c2e2f9

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) (cherry picked from commit 9871cfe)
1 parent b710e32 commit 1c2e2f9

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
@@ -97,9 +97,9 @@
9797
'an operator has configured glance property protections '
9898
'to make some image properties read-only. Cinder will '
9999
'*always* filter out image metadata in the namespaces '
100-
'`os_glance` and `img_signature`; this configuration '
101-
'option allows operators to specify *additional* '
102-
'namespaces to be excluded.',
100+
'`os_glance`, `img_signature` and `signature_verified`; '
101+
'this configuration option allows operators to specify '
102+
'*additional* namespaces to be excluded.',
103103
default=[]),
104104
]
105105

@@ -125,7 +125,8 @@
125125

126126
COMPRESSIBLE_IMAGE_FORMATS = ('qcow2',)
127127

128-
GLANCE_RESERVED_NAMESPACES = ["os_glance", "img_signature"]
128+
GLANCE_RESERVED_NAMESPACES = ["os_glance", "img_signature",
129+
"signature_verified"]
129130

130131

131132
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
@@ -2753,7 +2753,7 @@ def test_filter_out_reserved_namespaces_metadata_with_empty_metadata(self):
27532753
@ddt.unpack
27542754
def test_filter_out_reserved_namespaces_metadata(
27552755
self, metadata_for_test, config, keys_to_pop):
2756-
hardcoded_keys = ['os_glance', "img_signature"]
2756+
hardcoded_keys = image_utils.GLANCE_RESERVED_NAMESPACES
27572757

27582758
keys_to_pop = hardcoded_keys + keys_to_pop
27592759

@@ -2813,7 +2813,7 @@ def test_filter_out_reserved_namespaces_metadata(
28132813
@ddt.unpack
28142814
def test_filter_out_reserved_namespaces_metadata_properties(
28152815
self, metadata_for_test, config, keys_to_pop):
2816-
hardcoded_keys = ['os_glance', "img_signature"]
2816+
hardcoded_keys = image_utils.GLANCE_RESERVED_NAMESPACES
28172817

28182818
keys_to_pop = hardcoded_keys + keys_to_pop
28192819

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)