mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 07:04:52 +09:00
Allow deleting unassigned instances
Handle delete instance requests for instances that are not assigned to a slave.
This commit is contained in:
1 parent
541d2ad337
commit
3343d53d75
1 file changed
+12
@@ -411,6 +411,18 @@ class ControlConnection extends BaseConnection {
|
||||
db.instances.set(instanceId, instanceConfig);
|
||||
}
|
||||
|
||||
async deleteInstanceRequestHandler(message, request) {
|
||||
let instanceConfig = db.instances.get(message.data.instance_id);
|
||||
if (!instanceConfig) {
|
||||
throw new errors.RequestError(`Instance with ID ${message.data.instance_id} does not exist`);
|
||||
}
|
||||
|
||||
if (instanceConfig.get('instance.assigned_slave') !== null) {
|
||||
await this.forwardRequestToInstance(message, request);
|
||||
}
|
||||
db.instances.delete(message.data.instance_id);
|
||||
}
|
||||
|
||||
async getInstanceConfigRequestHandler(message) {
|
||||
let instanceConfig = db.instances.get(message.data.instance_id);
|
||||
if (!instanceConfig) {
|
||||
|
||||
Reference in new issue
Block a user