dotnet / dotnet/vscode-csharp

Unable to dynamically set pod name in pipeTransport

Open
#3,871 0 comments 2 reactions 0 assignees View on GitHub
Debugger OmniSharp
Dominant language
TypeScript
Stars
3.1k
Forks
737
Avg merge
18h 40m
Merged PRs (30d)
31

Description

Re-opening from: https://github.com/microsoft/vscode/issues/100831

I am trying to debug kubernetes dotnet core pods (running vscode in wsl2) and it works if I hard code the pod name in, but using an acceptable Linux command to retrieve it does not (see below):
```
{
"name": "Attach in k8s",
"type": "coreclr",
"request": "attach",
"processId": "${command:pickRemoteProcess}",
"justMyCode": false,
"requireExactSource": false,
"pipeTransport": {
"pipeProgram": "kubectl",
"pipeArgs": [
"exec -i -n my-service $(kubectl get pods -n my-service -o name | grep -Po '\\\/\\K.+') --"
],
"quoteArgs": false,
"debuggerPath": "/vsdbg/vsdbg"
},
"sourceFileMap": {
// For debugging you must copy source code into the app folder and point at the local folder with those
// source items
"/app": "${workspaceFolder}/MyService.Web"
}
}
```

It randomly tells me valid kubectl flags don't exist. I have tried to use pipeTransport.pipeEnvs with no luck as it is not documented. I have tried to use input variables also with no luck here. Also environment variables have not been able to resolve this. Lastly, creating a prelaunch task did not set an environment variable for me to use here.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.