Skip to content

Commit d960c62

Browse files
committed
insert another copy
1 parent 26f71be commit d960c62

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

packages/core/src/awsService/ec2/explorer/ec2ParentNode.ts

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,13 +47,6 @@ export class Ec2ParentNode extends AWSTreeNodeBase {
4747
}
4848
this.pollingSet.start(instanceId)
4949
}
50-
// Temporary inserted copy
51-
public trackPendingNode2(instanceId: string) {
52-
if (!this.ec2InstanceNodes.has(instanceId)) {
53-
throw new Error(`Attempt to track ec2 node ${instanceId} that isn't a child`)
54-
}
55-
this.pollingSet.start(instanceId)
56-
}
5750

5851
public async updateChildren(): Promise<void> {
5952
const ec2Instances = await (await this.ec2Client.getInstances()).toMap((instance) => instance.InstanceId)

packages/core/src/awsService/ec2/model.ts

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import { createBoundProcess } from '../../codecatalyst/model'
2525
import { getLogger } from '../../shared/logger/logger'
2626
import { CancellationError, Timeout } from '../../shared/utilities/timeoutUtils'
2727
import { showMessageWithCancel } from '../../shared/utilities/messages'
28-
import { SshConfig } from '../../shared/sshConfig'
28+
import { SshConfig, sshLogFileLocation } from '../../shared/sshConfig'
2929
import { SshKeyPair } from './sshKeyPair'
3030
import { Ec2SessionTracker } from './remoteSessionManager'
3131
import { getEc2SsmEnv } from './utils'
@@ -288,3 +288,22 @@ export class Ec2Connecter implements vscode.Disposable {
288288
throw new ToolkitError(`Unrecognized OS name ${osName} on instance ${instanceId}`, { code: 'UnknownEc2OS' })
289289
}
290290
}
291+
292+
// Manually inserted copy
293+
export function notACopy(
294+
selection: Ec2Selection,
295+
ssmPath: string,
296+
session: SSM.StartSessionResponse
297+
): NodeJS.ProcessEnv {
298+
return Object.assign(
299+
{
300+
AWS_REGION: selection.region,
301+
AWS_SSM_CLI: ssmPath,
302+
LOG_FILE_LOCATION: sshLogFileLocation('ec2', selection.instanceId),
303+
STREAM_URL: session.StreamUrl,
304+
SESSION_ID: session.SessionId,
305+
TOKEN: session.TokenValue,
306+
},
307+
process.env
308+
)
309+
}

0 commit comments

Comments
 (0)