Skip to content

Commit

Permalink
undo spawned process rename from parent back to child
Browse files Browse the repository at this point in the history
  • Loading branch information
GGonryun committed Mar 1, 2024
1 parent 13c78e5 commit 6c62c5d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/plugins/aws/ssm/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ const spawnSsmNode = async (options: {
subcommand?: string[];
}): Promise<number | null> =>
new Promise((resolve, reject) => {
const parent = spawn("/usr/bin/env", options.command, {
const child = spawn("/usr/bin/env", options.command, {
env: {
...process.env,
...options.credentials,
Expand All @@ -280,7 +280,7 @@ const spawnSsmNode = async (options: {

const subprocesses = subcommandLauncher(options.credentials);

const stream = interceptSessionOutput(parent, {
const stream = interceptSessionOutput(child, {
onSessionStart() {
const subcommand = options?.subcommand ?? [];
if (subcommand.length) {
Expand All @@ -295,9 +295,9 @@ const spawnSsmNode = async (options: {
print2("SSH session terminated");
};

const { isAccessPropagated } = accessPropagationGuard(parent);
const { isAccessPropagated } = accessPropagationGuard(child);

const exitListener = parent.on("exit", (code) => {
const exitListener = child.on("exit", (code) => {
exitListener.unref();
// In the case of ephemeral AccessDenied exceptions due to unpropagated
// permissions, continually retry access until success
Expand Down

0 comments on commit 6c62c5d

Please sign in to comment.