Image owner incorrectly changes when accepting shared image membership with --project flag
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| python-openstackclient |
Fix Released
|
Undecided
|
Abhishek Kekane | ||
Bug Description
When using `openstack image set --project <project_id> --accept <image_id>` to accept a shared image membership, the command incorrectly changes the image owner to the specified project instead of only updating the member status.
Steps to Reproduce:
===================
1. Create an image in tenantA as a private image
2. Change the image visibility to shared
3. Add tenantB as a member: `openstack image add project <image_id> <tenantB_id>` (from tenantA)
4. In tenantB, accept the membership: `openstack image set --project <tenantB_id> --accept <image_id>`
5. Check the image owner: `openstack image show <image_id>`
Expected Behavior:
=================
- The member status should change from `pending` to `accepted`
- The image owner should remain tenantA (the original producer)
- Users in tenantA should still be able to see and manage the image
Actual Behavior:
================
- The member status changes to `accepted` (correct)
- The image owner changes to tenantB (incorrect - BUG)
- Users in tenantA can no longer see the image in their image list
- The original producer (tenantA) loses access to their own image
Workaround:
===========
Use separate commands:
- `openstack image set --accept <image_id>` (uses current project)
- OR `openstack image member set <image_id> <member_project_id> accepted`
Proposed Fix:
=============
When --accept, --reject, or --pending flags are used, the --project parameter should only identify which member's status to update, and should NOT set the owner_id. Only set owner_id when --project is used without membership flags.
| Changed in python-openstackclient: | |
| assignee: | nobody → Abhishek Kekane (abhishek-kekane) |
Fix proposed to branch: master /review. opendev. org/c/openstack /python- openstackclient /+/971392
Review: https:/