[v2] fix: handle Nova create image response for microversion 2.45 and above#3559
Merged
[v2] fix: handle Nova create image response for microversion 2.45 and above#3559
Conversation
Since microversion 2.45, the Location header is removed from the create image response. The image ID is now returned in the response body as JSON. CreateImage now reads the response body and stores it in CreateImageResult. The image ID extraction checks X-OpenStack-Nova-API-Version to determine whether to extract the ID from the Location header (< 2.45) or the response body (>= 2.45).
mandre
approved these changes
Nov 17, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Backport: #3543
Description
This change addresses an issue where the Nova CreateImage API response was not handled correctly for microversion 2.45 and above.
Prior to microversion 2.45, the image ID was extracted from the Location header. Starting with 2.45, Nova no longer includes the Location header. Instead, the image ID is returned in the response body as a small JSON object. (see API reference)
The
CreateImagefunction has been updated to:CreateImageResult.X-OpenStack-Nova-API-Versionheader:Locationheader.This fix resolves the issue where the image ID was previously empty for Nova 2.45+, while maintaining compatibility with older microversions.
Fixes #3542