Skip to content

fix (image/v2/images): image v2 unmarshal issue - #3589

Merged
kayrus merged 3 commits into
gophercloud:mainfrom
chanchiwai-ray:bug/#3588
Dec 19, 2025
Merged

kayrus merged 3 commits into
gophercloud:mainfrom
chanchiwai-ray:bug/#3588

Conversation

@chanchiwai-ray

Copy link
Copy Markdown
Contributor

This PR address the unmarshal issue when user add an additional property properties to the image using openstack image set <IMAGE> --property <KEY>=<VALUE> ..., which collides with the field in Image.Properties with a type of map[string]any.

Fixes #3588

See the issue above to reproduce a test case.

Comment thread openstack/image/v2/images/results.go
@kayrus

kayrus commented Dec 18, 2025

Copy link
Copy Markdown
Contributor

Thanks for the PR. See my comment above. In addition could you please add functional tests to cover this case?

@chanchiwai-ray

Copy link
Copy Markdown
Contributor Author

I will provide some functional tests later

@chanchiwai-ray

Copy link
Copy Markdown
Contributor Author

I updated the CreateEmptyImage function to include additional property called properties, this should be enough to cover the case. Tested on devstack, the old behavior without this patch failed; the new behavior passes.

@kayrus kayrus left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM, thanks!

@kayrus
kayrus enabled auto-merge December 19, 2025 10:34
@kayrus
kayrus added this pull request to the merge queue Dec 19, 2025
Merged via the queue into gophercloud:main with commit 227905e Dec 19, 2025
62 checks passed
@chanchiwai-ray
chanchiwai-ray deleted the bug/#3588 branch December 22, 2025 01:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-v2 This PR will be backported to v2 edit:image This PR updates image code semver:patch No API change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image V2: cannot unmarshal string into Go struct field .images.tmp.Properties of type map[string]interface {}

2 participants