feat: Kubernetes operator for MCP server management #47
@@ -270,10 +270,20 @@ export class RestoreService {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Resolve a valid owner — prefer system user, fall back to first user
|
||||
let ownerId = '';
|
||||
if (this.userRepo) {
|
||||
const allUsers = await this.userRepo.findAll();
|
||||
for (const u of allUsers) {
|
||||
if (u.email === 'system@mcpctl.local') { ownerId = u.id; break; }
|
||||
if (!ownerId) ownerId = u.id;
|
||||
}
|
||||
}
|
||||
|
||||
const projectCreateData: { name: string; description: string; ownerId: string; proxyModel?: string; llmProvider?: string; llmModel?: string } = {
|
||||
name: project.name,
|
||||
description: project.description,
|
||||
ownerId: 'system',
|
||||
ownerId,
|
||||
};
|
||||
if (project.proxyModel) projectCreateData.proxyModel = project.proxyModel;
|
||||
if (project.llmProvider != null) projectCreateData.llmProvider = project.llmProvider;
|
||||
|
||||
Reference in New Issue
Block a user