File tree Expand file tree Collapse file tree 2 files changed +15
-2
lines changed
packages/core/src/awsService/sagemaker Expand file tree Collapse file tree 2 files changed +15
-2
lines changed Original file line number Diff line number Diff line change @@ -132,8 +132,10 @@ export async function deeplinkConnect(
132132
133133 try {
134134 let connectionType = 'sm_dl'
135- if ( domain === '' ) {
135+ if ( domain === '' && eksClusterArn ) {
136+ const { accountId, region, clusterName } = parseEKSClusterArn ( eksClusterArn )
136137 connectionType = 'sm_hp'
138+ session = `${ workspaceName } _${ namespace } _${ clusterName } _${ region } _${ accountId } `
137139 }
138140 const remoteEnv = await prepareDevEnvConnection (
139141 connectionIdentifier ,
@@ -179,6 +181,17 @@ export async function deeplinkConnect(
179181 }
180182}
181183
184+ function parseEKSClusterArn ( eksClusterArn : string ) : { accountId : string ; region : string ; clusterName : string } {
185+ const parts = eksClusterArn . split ( ':' )
186+ if ( parts . length !== 6 ) {
187+ throw new Error ( `Invalid EKS cluster ARN: ${ eksClusterArn } ` )
188+ }
189+ const accountId = parts [ 4 ]
190+ const region = parts [ 3 ]
191+ const clusterName = parts [ 5 ] . split ( '/' ) [ 1 ]
192+ return { accountId, region, clusterName }
193+ }
194+
182195export async function stopSpace (
183196 node : SagemakerSpaceNode | SagemakerUnifiedStudioSpaceNode ,
184197 ctx : vscode . ExtensionContext ,
Original file line number Diff line number Diff line change @@ -186,7 +186,7 @@ export async function prepareDevEnvConnection(
186186
187187 const hyperPodEnv : NodeJS . ProcessEnv = {
188188 AWS_REGION : region ,
189- SESSION_ID : session || '' ,
189+ SESSION_ID : hostname || '' ,
190190 STREAM_URL : decodedWsUrl ,
191191 TOKEN : decodedToken ,
192192 AWS_SSM_CLI : ssm ,
You can’t perform that action at this time.
0 commit comments