Merge "openstack: Remove metadata limit checks"

This commit is contained in:
Zuul 2022-05-24 01:59:39 +00:00 committed by Gerrit Code Review
commit 67c1cb2db8
3 changed files with 14 additions and 14 deletions

View File

@ -257,10 +257,7 @@ Selecting the OpenStack driver adds the following options to the
.. attr:: meta
:type: dict
Arbitrary key/value metadata to store for this server using
the Nova metadata service. A maximum of five entries is
allowed, and both keys and values must be 255 characters or
less.
Arbitrary key/value metadata to store as glance image properties.
.. attr:: connection-type
:type: string

View File

@ -265,16 +265,6 @@ class OpenStackProviderConfig(ProviderConfig):
# This dict is expanded and used as custom properties when
# the image is uploaded.
i.meta = image.get('meta', {})
# 5 elements, and no key or value can be > 255 chars
# per Nova API rules
if i.meta:
if len(i.meta) > 5 or \
any([len(k) > 255 or len(v) > 255
for k, v in i.meta.items()]):
# soft-fail
# self.log.error("Invalid metadata for %s; ignored"
# % i.name)
i.meta = {}
for image in self.provider.get('cloud-images', []):
i = ProviderCloudImage()

View File

@ -0,0 +1,13 @@
---
fixes:
- |
Removes diskimage.meta checks from the OpenStack driver. The limit of only
5 entries is anachronistic and now removed. Rather than trying to pre-guess
what OpenStack wants the metadata is now passed as-is and OpenStack will
reject it at upload time.
Previously, metadata was checked by nodepool and invalid values would cause
all metadata to be silently ignored. Now, metadata will be passed directly
to glance, and an API error will occur. This may mean that images that
previously uploaded (with no metadata) will now cause an API error when
uploading.