diff --git a/pkg/skaffold/debug/transform_go.go b/pkg/skaffold/debug/transform_go.go index c85c8b0bcf6..6dbe83874ea 100644 --- a/pkg/skaffold/debug/transform_go.go +++ b/pkg/skaffold/debug/transform_go.go @@ -64,7 +64,7 @@ func isLaunchingDlv(args []string) bool { } func (t dlvTransformer) IsApplicable(config ImageConfiguration) bool { - for _, name := range []string{"GODEBUG", "GOGC", "GOMAXPROCS", "GOTRACEBACK"} { + for _, name := range []string{"GODEBUG", "GOGC", "GOMAXPROCS", "GOTRACEBACK", "KO_DATA_PATH"} { if _, found := config.Env[name]; found { log.Entry(context.TODO()).Infof("Artifact %q has Go runtime: has env %q", config.Artifact, name) return true diff --git a/pkg/skaffold/debug/transform_go_test.go b/pkg/skaffold/debug/transform_go_test.go index 2eaf37973fe..a9f51c6ec89 100644 --- a/pkg/skaffold/debug/transform_go_test.go +++ b/pkg/skaffold/debug/transform_go_test.go @@ -86,6 +86,12 @@ func TestDlvTransformer_IsApplicable(t *testing.T) { source: ImageConfiguration{Env: map[string]string{"GOTRACEBACK": "off"}}, result: true, }, + { + // detect images built by ko: https://github.com/google/ko#static-assets + description: "KO_DATA_PATH", + source: ImageConfiguration{Env: map[string]string{"KO_DATA_PATH": "cmd/app/kodata/"}}, + result: true, + }, { description: "entrypoint with dlv", source: ImageConfiguration{Entrypoint: []string{"dlv", "exec", "--headless"}},