Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

make runAdminCommand async

DimitrisStaratzis5554bfae4795
diff --git a/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.ts b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.ts
index 3ec4545e04..a0ddd93a18 100644
--- a/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.ts
+++ b/backend/src/ee/services/secret-rotation-v2/unix-linux-local-account-rotation/unix-linux-local-account-rotation-fns.ts
@@ -193,7 +193,7 @@ const changeManagedPassword = async (
export type TAdminCommandResult = { output: string; exitCode: number | null };
-export const runAdminCommand = (
+export const runAdminCommand = async (
stream: TInteractiveShellStream,
appConnectionPassword?: string
): Promise<TAdminCommandResult> => {
@@ -205,7 +205,7 @@ export const runAdminCommand = (
exitCode = code;
});
- return runExpectSession({
+ await runExpectSession({
stream,
secrets: [appConnectionPassword],
@@ -236,7 +236,9 @@ export const runAdminCommand = (
overflowMessage: (t) =>
`Command failed: the host sent more than ${MAX_BUFFER_SIZE / 1024} KB of output without finishing. Output: ${t}`,
timeoutMessage: (t) => `Command timed out. Output: ${t}`
- }).then(() => ({ output, exitCode }));
+ });
+
+ return { output, exitCode };
};
const createAdminCommandRunner =