Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

openstack_images_image_v2: don't set "hidden" field by default #1209

Merged
merged 1 commit into from
Mar 23, 2021
Merged

openstack_images_image_v2: don't set "hidden" field by default #1209

merged 1 commit into from
Mar 23, 2021

Conversation

rnurgaliyev
Copy link
Contributor

Change #1186 has incidentally broken openstack_images_image_v2 resource for all Glance servers with API before 2.7.

OpenStack releases before Rocky don't have a "hidden" field in the image schema. Setting it to anything will result in an API crash. Since the default value is "false" anyways, it is safe just to omit this field if it is set to false, to save some backward compatibility.

Example of failure message:

Error: Error updating image: Bad request with: [PATCH https://imageservice.local:9292/v2/images/5f8b8949-573c-4b0f-aa9e-42b909611f01], error message: {"message": "Provided object does not match schema 'image': True is not of type 'string'\n\nFailed validating 'type' in schema['additionalProperties']:\n    {'type': 'string'}\n\nOn instance[u'os_hidden']:\n    True<br /><br />\n\n\n", "code": "400 Bad Request", "title": "Bad Request"}

Signed-off-by: Renat Nurgaliyev impleman@gmail.com

@theopenlab-ci
Copy link

theopenlab-ci bot commented Mar 17, 2021

Build failed.

OpenStack releases before Rocky don't have a "hidden" field in the
image schema. Setting it to anything will result in an API crash.
Since the default value is "false" anyways, it is safe just to omit
this field if it is set to false, to save some backward compatibility.

Signed-off-by: Renat Nurgaliyev <impleman@gmail.com>
Copy link
Member

@ozerovandrei ozerovandrei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ozerovandrei ozerovandrei merged commit 2b305c3 into terraform-provider-openstack:main Mar 23, 2021
@rnurgaliyev rnurgaliyev deleted the fix-os-hidden branch April 1, 2022 08:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants