yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #86831
[Bug 1939169] [NEW] glance md-tag-create-multiple overwrites existing tags
Public bug reported:
Our md-tag-create-multiple (/v2/metadefs/namespaces/{namespace_name}/tags) [1] API overwrites existing tags for specified namespace rather than creating new one in addition to the existing tags.
Where as if you try to create different tags using md-tag-create (/v2/metadefs/namespaces/{namespace_name}/tags/{tag_name}) it is working as expected, means adding new tag in addition to existing ones.
Steps to reproduce:
1. source using admin credentials
$ source devstack/openrc admin admin
2. Create new public namespace
$ glance md-namespace-create TagsBugNamespace --visibility public
+------------+----------------------------------+
| Property | Value |
+------------+----------------------------------+
| created_at | 2021-08-06T17:43:03Z |
| namespace | TagsBugNamespace |
| owner | a14a058e2d1540c3a0dc7c397c55174e |
| protected | False |
| schema | /v2/schemas/metadefs/namespace |
| updated_at | 2021-08-06T17:43:03Z |
| visibility | public |
+------------+----------------------------------+
3. Create single tag using md-tag-create command
$ glance md-tag-create TagsBugNamespace --name tag1
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2021-08-06T17:57:37Z |
| name | tag1 |
| updated_at | 2021-08-06T17:57:37Z |
+------------+----------------------+
4. Create another tag
$ glance md-tag-create TagsBugNamespace --name tag2
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2021-08-06T17:57:37Z |
| name | tag2 |
| updated_at | 2021-08-06T17:57:37Z |
+------------+----------------------+
5. Verify that we have two tags in the list
$ glance md-tag-list TagsBugNamespace
+------+
| name |
+------+
| tag2 |
| tag1 |
+------+
6. Add more tags using md-tag-crate-multiple command
$ glance md-tag-create-multiple TagsBugNamespace --names TestTag1141=TestTag2411 --delim =
+-------------+
| name |
+-------------+
| TestTag1141 |
| TestTag2411 |
+-------------+
7. Now run tags list command again
$ glance md-tag-list TagsBugNamespace
+-------------+
| name |
+-------------+
| TestTag2411 |
| TestTag1141 |
+-------------+
Expected result:
These new tags should have been added to existing tags.
Actual result:
Existing tags gets deleted and only newly added tags using md-tag-crate-multiple command remains.
* This is further to show that adding new tag using md-tag-create command now will add a new tag and does not overwrite existing ones.
$ glance md-tag-create TagsBugNamespace --name tag3
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2021-08-06T18:12:14Z |
| name | tag3 |
| updated_at | 2021-08-06T18:12:14Z |
+------------+----------------------+
* Verify that we have not overwritten existing tags now;
$ glance md-tag-list TagsBugNamespace
+-------------+
| name |
+-------------+
| tag3 |
| TestTag2411 |
| TestTag1141 |
+-------------+
[1] https://docs.openstack.org/api-ref/image/v2/metadefs-
index.html?expanded=create-tag-definition-detail,create-tags-detail,get-
tag-definition-detail,delete-all-tag-definitions-detail#create-tags
** Affects: glance
Importance: High
Status: New
** Affects: glance/xena
Importance: High
Status: New
** Changed in: glance
Importance: Undecided => High
** Description changed:
Our md-tag-create-multiple (/v2/metadefs/namespaces/{namespace_name}/tags) [1] API overwrites existing tags for specified namespace rather than creating new one in addition to the existing tags.
Where as if you try to create different tags using md-tag-create (/v2/metadefs/namespaces/{namespace_name}/tags/{tag_name}) it is working as expected, means adding new tag in addition to existing ones.
Steps to reproduce:
1. source using admin credentials
$ source devstack/openrc admin admin
2. Create new public namespace
- $ glance md-namespace-create TagsBugNamespace --visibility public
+ $ glance md-namespace-create TagsBugNamespace --visibility public
+------------+----------------------------------+
| Property | Value |
+------------+----------------------------------+
| created_at | 2021-08-06T17:43:03Z |
| namespace | TagsBugNamespace |
| owner | a14a058e2d1540c3a0dc7c397c55174e |
| protected | False |
| schema | /v2/schemas/metadefs/namespace |
| updated_at | 2021-08-06T17:43:03Z |
| visibility | public |
+------------+----------------------------------+
3. Create single tag using md-tag-create command
$ glance md-tag-create TagsBugNamespace --name tag1
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2021-08-06T17:57:37Z |
| name | tag1 |
| updated_at | 2021-08-06T17:57:37Z |
+------------+----------------------+
4. Create another tag
$ glance md-tag-create TagsBugNamespace --name tag2
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2021-08-06T17:57:37Z |
| name | tag2 |
| updated_at | 2021-08-06T17:57:37Z |
+------------+----------------------+
5. Verify that we have two tags in the list
$ glance md-tag-list TagsBugNamespace
+------+
| name |
+------+
| tag2 |
| tag1 |
+------+
-
6. Add more tags using md-tag-crate-multiple command
$ glance md-tag-create-multiple TagsBugNamespace --names TestTag1141=TestTag2411 --delim =
+-------------+
| name |
+-------------+
| TestTag1141 |
| TestTag2411 |
+-------------+
7. Now run tags list command again
$ glance md-tag-list TagsBugNamespace
+-------------+
| name |
+-------------+
| TestTag2411 |
| TestTag1141 |
+-------------+
Expected result:
These new tags should have been added to existing tags.
Actual result:
Existing tags gets deleted and only newly added tags using md-tag-crate-multiple command remains.
-
* This is further to show that adding new tag using md-tag-create command now will add a new tag and does not overwrite existing ones.
$ glance md-tag-create TagsBugNamespace --name tag3
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2021-08-06T18:12:14Z |
| name | tag3 |
| updated_at | 2021-08-06T18:12:14Z |
+------------+----------------------+
* Verify that we have not overwritten existing tags now;
$ glance md-tag-list TagsBugNamespace
+-------------+
| name |
+-------------+
| tag3 |
| TestTag2411 |
| TestTag1141 |
+-------------+
+
+ [1] https://docs.openstack.org/api-ref/image/v2/metadefs-
+ index.html?expanded=create-tag-definition-detail,create-tags-detail,get-
+ tag-definition-detail,delete-all-tag-definitions-detail#create-tags
** Also affects: glance/xena
Importance: High
Status: New
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Glance.
https://bugs.launchpad.net/bugs/1939169
Title:
glance md-tag-create-multiple overwrites existing tags
Status in Glance:
New
Status in Glance xena series:
New
Bug description:
Our md-tag-create-multiple (/v2/metadefs/namespaces/{namespace_name}/tags) [1] API overwrites existing tags for specified namespace rather than creating new one in addition to the existing tags.
Where as if you try to create different tags using md-tag-create (/v2/metadefs/namespaces/{namespace_name}/tags/{tag_name}) it is working as expected, means adding new tag in addition to existing ones.
Steps to reproduce:
1. source using admin credentials
$ source devstack/openrc admin admin
2. Create new public namespace
$ glance md-namespace-create TagsBugNamespace --visibility public
+------------+----------------------------------+
| Property | Value |
+------------+----------------------------------+
| created_at | 2021-08-06T17:43:03Z |
| namespace | TagsBugNamespace |
| owner | a14a058e2d1540c3a0dc7c397c55174e |
| protected | False |
| schema | /v2/schemas/metadefs/namespace |
| updated_at | 2021-08-06T17:43:03Z |
| visibility | public |
+------------+----------------------------------+
3. Create single tag using md-tag-create command
$ glance md-tag-create TagsBugNamespace --name tag1
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2021-08-06T17:57:37Z |
| name | tag1 |
| updated_at | 2021-08-06T17:57:37Z |
+------------+----------------------+
4. Create another tag
$ glance md-tag-create TagsBugNamespace --name tag2
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2021-08-06T17:57:37Z |
| name | tag2 |
| updated_at | 2021-08-06T17:57:37Z |
+------------+----------------------+
5. Verify that we have two tags in the list
$ glance md-tag-list TagsBugNamespace
+------+
| name |
+------+
| tag2 |
| tag1 |
+------+
6. Add more tags using md-tag-crate-multiple command
$ glance md-tag-create-multiple TagsBugNamespace --names TestTag1141=TestTag2411 --delim =
+-------------+
| name |
+-------------+
| TestTag1141 |
| TestTag2411 |
+-------------+
7. Now run tags list command again
$ glance md-tag-list TagsBugNamespace
+-------------+
| name |
+-------------+
| TestTag2411 |
| TestTag1141 |
+-------------+
Expected result:
These new tags should have been added to existing tags.
Actual result:
Existing tags gets deleted and only newly added tags using md-tag-crate-multiple command remains.
* This is further to show that adding new tag using md-tag-create command now will add a new tag and does not overwrite existing ones.
$ glance md-tag-create TagsBugNamespace --name tag3
+------------+----------------------+
| Property | Value |
+------------+----------------------+
| created_at | 2021-08-06T18:12:14Z |
| name | tag3 |
| updated_at | 2021-08-06T18:12:14Z |
+------------+----------------------+
* Verify that we have not overwritten existing tags now;
$ glance md-tag-list TagsBugNamespace
+-------------+
| name |
+-------------+
| tag3 |
| TestTag2411 |
| TestTag1141 |
+-------------+
[1] https://docs.openstack.org/api-ref/image/v2/metadefs-
index.html?expanded=create-tag-definition-detail,create-tags-
detail,get-tag-definition-detail,delete-all-tag-definitions-
detail#create-tags
To manage notifications about this bug go to:
https://bugs.launchpad.net/glance/+bug/1939169/+subscriptions
Follow ups