edgedb-cli icon indicating copy to clipboard operation
edgedb-cli copied to clipboard

Check for instance before confirmation prompt on `instance delete`

Open colinhacks opened this issue 2 years ago • 1 comments

$ edgedb instance destroy -I nonexistent_instance
Do you really want to delete instance "nonexistent_instance"? (type `Yes`)
> Yes
edgedb error: instance not found: instance not found

colinhacks avatar Aug 27 '22 02:08 colinhacks

The problem with checking whether instance exists here is inconsistent. This command is designed to clean every remnant of the instance even if it was half-wiped before (i.e. interrupted destroy, manual file poking, filesystem failure, whatever). This is even more error-prone with systemctl/launchctl when user have poked with them somehow.

So even if instance is not listed in edgedb instance list, some files could be deleted.

So I'm thinking of the command rm -rf non-existent where it's not an error to delete a non-existing file. And trying to fix this is quite error prone so I'm not sure if it worth adding that implementation complexity.

tailhook avatar Aug 29 '22 15:08 tailhook

Don't see many confused users so far. Let's keep it as is for now.

tailhook avatar May 23 '23 11:05 tailhook