Metadef Resource types are not getting flushing out from DB
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance |
Opinion
|
Wishlist
|
Pranali Deore |
Bug Description
The resource types are not getting deleted form database even after deleting from CLI
$ glance md-resource-
+------
| Property | Value |
+------
| created_at | 2021-09-
| name | test-resource-
| updated_at | 2021-09-
+------
$ glance md-resource-
$ mysql
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 16967
Server version: 5.7.35-
Copyright (c) 2000, 2021, Oracle and/or its affiliates.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use glance;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select * from metadef_
+------
| id | name | protected | created_at | updated_at |
+------
| 4 | test-resource-
+------
The resource type needs to be deleted from the db.
Changed in glance: | |
assignee: | nobody → Pranali Deore (pranali-deore) |
Changed in glance: | |
importance: | Undecided → Wishlist |
I think this is not a bug and by design from the beginning. If metadef_ resource_ types are not associated with any namespaces then they will remain in metadef_ resource_ types table forever.
If any resource type is associated with metadef_namespaces then new entry will be added in 'metadef_ namespace_ resource_ types' and while de-associating it will delete the resource type from that table but keeps it in metadef_ resource_ types table so that if anyone wants to use that in future then that can be associated to with same or different namespace.
Same thing goes with deleting the namespace without de-associating resource-types, it will clear/delete reource-types from metadef_ namespace_ resource_ types table but will keep it in metadef_ resource_ types table.
If we want to delete the resource type from the metadef_ resource_ types on deassociation and deleting the namespace as well then I think that will be API behavior change and requires a spec for further discussion.