-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Creating a template sharing the same name as a deleted template causes an error #363
Comments
@kdeng3849 @gianarb , Also regarding issue where user is not able to create a new template with the same name even after deleting the existing one, this is also an issue and needed a fix. As per the above comment, I would like to do following fixes for this issue:
Please let me know if you feel any concern with the approach or fixes asap. |
So is there no way to permanently delete a workflow template? It seems weird to me as a user that if I delete something it still hangs around. |
Signed-off-by: parauliya <aman@infracloud.io>
Signed-off-by: parauliya <aman@infracloud.io>
Signed-off-by: parauliya <aman@infracloud.io>
Signed-off-by: parauliya <aman@infracloud.io> ## Description This PR will fix allow user to create a template with the same name after deleting it. Before this, it was not possible because of an issue also after deleting a template all the workflow which were created with that template before deleting it will be able to access the template since we template will be deleted softly. ## Why is this needed Fixes: #363 ## How Has This Been Tested? Tested all the scenarios mentioned in the linked issue manually using vagrant setup. ## How are existing users impacted? What migration steps/scripts do we need? Have written a migration script for db. ## Checklist: I have: - [ ] updated the documentation and/or roadmap (if required) - [x] added unit or e2e tests - [ ] provided instructions on how to upgrade
Expected Behaviour
Templates can be successfully created even when it shares the same name as a deleted template.
Current Behaviour
Due to the fact that templates are soft deleted and the recent change of name also being a unique field, creating a template sharing the same name as a deleted template returns this error:
Possible Solution
Steps to Reproduce (for bugs)
Context
At first, I thought the soft delete was to be able to get workflow data even after the associated template has been (soft) deleted, but this is not the case. Therefore, what exactly is the purpose of soft deleting?
Granted, there is a workaround for this (e.g. use a UUID as part of the name), but it seems unintuitive that new templates have to take deleted templates into consideration. Also, the only way to see what names have already been used is going into the db.
Your Environment
Operating System and version (e.g. Linux, Windows, MacOS):
Ubuntu 18.04
How are you running Tinkerbell? Using Vagrant & VirtualBox, Vagrant & Libvirt, on Packet using Terraform, or give details:
Reproducing the error
Getting a workflow with a deleted associated template
Original reporter: Matt Burns
The text was updated successfully, but these errors were encountered: