The API for volume v3 update/delete encryption type differs from the documentation

Bug #1835186 reported by wangzhiguang
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
New
Undecided
Unassigned
tempest
Confirmed
Medium
Unassigned

Bug Description

In the API for volume v3,update/delete encryption type interface is types/{volume_type_id}/encryption/{encryption_id} and types/{volume_type_id}/encryption/{encryption_id}.But,the interface used is /types/%s/encryption/provider by the tempest/lib/services/volume/v3/ path, encryption_types_client.py file.Two things are different。

Revision history for this message
wangzhiguang (wzginspur) wrote :
wangzhiguang (wzginspur)
Changed in tempest:
status: New → Confirmed
status: Confirmed → New
assignee: nobody → wangzhiguang (wzginspur)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to tempest (master)

Fix proposed to branch: master
Review: https://review.opendev.org/669614

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on tempest (master)

Change abandoned by wangzhiguang (<email address hidden>) on branch: master
Review: https://review.opendev.org/669614

Revision history for this message
Doug Schveninger (ds6901) wrote : Re: In the API for volume v3, update/delete encryption type interface is different from code in the encryption_types_client.py file

I was reviewing the bug and wondering if the bug is still valid since the review and patchset being abandon. Is the bug still valid?

Revision history for this message
Martin Kopec (mkopec) wrote :

I'm changing the assignee to Nobody, as there's no activity in the last 6 months.

Anyway, I think the bug is valid. According the documentation [1] urls for DELETE and PUT should look like:
/v3/{project_id}/types/{volume_type_id}/encryption/{encryption_id}
However, the code contains this [2][3]. There's 'provider' instead of the encryption_id. I wonder why it isn't causing any troubles, are the methods even used? I'm gonna check. I'll put the bug to Confirmed meanwhile.

[1] https://docs.openstack.org/api-ref/block-storage/v3/index.html?expanded=update-an-encryption-type-detail#update-an-encryption-type
[2] https://opendev.org/openstack/tempest/src/commit/5785a7d18040ed8e48f7f58ed8bff972f5f25e01/tempest/lib/services/volume/v3/encryption_types_client.py#L85
[3] https://opendev.org/openstack/tempest/src/commit/5785a7d18040ed8e48f7f58ed8bff972f5f25e01/tempest/lib/services/volume/v3/encryption_types_client.py#L74

Changed in tempest:
assignee: wangzhiguang (wzginspur) → nobody
status: New → Confirmed
Martin Kopec (mkopec)
summary: - In the API for volume v3, update/delete encryption type interface is
- different from code in the encryption_types_client.py file
+ The API for volume v3 update/delete encryption type differs from the
+ documentation
Revision history for this message
Ghanshyam Mann (ghanshyammann) wrote :

yes, url used in Tempest is wrong. i cannot find such API in cinder.

This is used in below test and we need to investigate why it is working and not giving error. May be 'provider' string is taken as id by cinder API but at some stage it should return error as this is unknown id.
- https://opendev.org/openstack/tempest/src/commit/acfb494c854819cc4b335ea51d3195d097c3f9cb/tempest/api/volume/admin/test_volume_types.py

Changed in tempest:
importance: Undecided → Medium
Revision history for this message
Lukas Piwowarski (lukas-piwowarski) wrote :

I am not entirely sure but it seems that cinder internally needs only the volume type id when updating or deleting encryption type [1][2][3]. When an encryption type is created via the API it must be connected to a volume type which suggests that volume type id should be enough for identifying the encryption type.

Also when the /v3/{project_id}/types/{volume_type_id}/encryption/{encryption_id} request is send with valid values for {project_id} and {volume_type_id} the request will pass as long as {encryption_id} contains any value (e.g. "abcd") and the volume type has an encryption type.

[1] https://github.com/openstack/cinder/blob/4580c56058a39726dd174b1aefa7b3eacc63904c/cinder/api/contrib/volume_type_encryption.py#L113
[2] https://github.com/openstack/cinder/blob/4580c56058a39726dd174b1aefa7b3eacc63904c/cinder/api/contrib/volume_type_encryption.py#L151
[3] https://github.com/openstack/cinder/blob/e8f03523e8d244fb9c1ecceb091784cc37d63b0d/cinder/db/api.py#L873

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

Bug watches keep track of this bug in other bug trackers.