mirror of
https://github.com/whyour/qinglong.git
synced 2026-09-22 10:32:40 +08:00
fix(ql3): preserve automation manager least privilege
This commit is contained in:
+2
-3
@@ -319,8 +319,7 @@ async function loadPlan(
|
||||
const result = await client.query<Row>(
|
||||
`SELECT plan_json AS "planJson"
|
||||
FROM "ql3"."cluster_legacy_env_migration_plans"
|
||||
WHERE plan_id = $1
|
||||
FOR SHARE`,
|
||||
WHERE plan_id = $1`,
|
||||
[intent.planId],
|
||||
);
|
||||
if (result.rows.length !== 1) throw conflict();
|
||||
@@ -1126,7 +1125,7 @@ export class PostgresClusterLegacyEnvMigrationApplicationRepository
|
||||
);
|
||||
if (occupied) throw conflict();
|
||||
const project = await client.query<{ status: unknown }>(
|
||||
`SELECT status FROM "ql3"."projects" WHERE id = $1 FOR SHARE`,
|
||||
`SELECT status FROM "ql3"."projects" WHERE id = $1`,
|
||||
[intent.projectId],
|
||||
);
|
||||
if (project.rows.length !== 1 || project.rows[0]?.status !== 'active') {
|
||||
|
||||
Reference in New Issue
Block a user