Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugging ko with Cloud Code in VS Code #1461

Open
Evynglais opened this issue Dec 11, 2024 · 1 comment
Open

Debugging ko with Cloud Code in VS Code #1461

Evynglais opened this issue Dec 11, 2024 · 1 comment

Comments

@Evynglais
Copy link

Evynglais commented Dec 11, 2024

Hi,

Looking for some guidance - trying to debug an app in Kubernetes using Cloud Code. I can get it to connect to the debugger, but can't get it to stop on any breakpoints.

My guess is that either the localRoot or remoteRoot is wrong, but not sure why.

TIA.

Command to apply:

ko apply --debug --disable-optimizations -f containersource.yaml

Partial ContainerSource YAML:

apiVersion: sources.knative.dev/v1
kind: ContainerSource
metadata:
  name: backend
spec:
  template:
    spec:
      containers:
        - image: ko://path/to/backend
          ports:
            - containerPort: 40000

Launch Configuration JSON:

{
    "version": "0.2.0",
    "configurations": [
        {
            "name": "Attach to Backend",
            "type": "cloudcode.kubernetes",
            "request": "attach",
            "language": "Go",
            "debugPort": 40000,
            "podSelector": {
                "sources.knative.dev/containerSource": "backend"
            },
            "localRoot": "${workspaceFolder}",
            "remoteRoot": "/ko-app",
        },
  ]
}
@Evynglais
Copy link
Author

Seems to work with

"remoteRoot": ""

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant