Skip to content

Commit 64a1c14

Browse files
authored
feat(go): support go 1.24 and delve 1.24.1 (#145)
1 parent f5017c6 commit 64a1c14

File tree

4 files changed

+102
-4
lines changed

4 files changed

+102
-4
lines changed

go/helper-image/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
ARG GOVERSION=1.23
1+
ARG GOVERSION=1.24
22
FROM --platform=$BUILDPLATFORM golang:${GOVERSION} AS delve
33
ARG BUILDPLATFORM
44
ARG TARGETOS
55
ARG TARGETARCH
66

7-
ARG DELVE_VERSION=1.23.1
7+
ARG DELVE_VERSION=1.24.1
88

99
# Patch delve to make defaults for --check-go-version and --only-same-user
1010
# to be set at build time. We must install patch(1) to apply the patch.

go/helper-image/delve-as-options.patch

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
diff --git cmd/dlv/cmds/commands.go cmd/dlv/cmds/commands.go
2-
index b5b7662c..dcdae257 100644
2+
index 374b5451..ad1c6b69 100644
33
--- cmd/dlv/cmds/commands.go
44
+++ cmd/dlv/cmds/commands.go
55
@@ -61,6 +61,8 @@ var (
@@ -31,7 +31,7 @@ index b5b7662c..dcdae257 100644
3131
rootCommand.PersistentFlags().StringVar(&backend, "backend", "default", `Backend selection (see 'dlv help backend').`)
3232
must(rootCommand.RegisterFlagCompletionFunc("backend", cobra.FixedCompletions([]string{"default", "native", "lldb", "rr"}, cobra.ShellCompDirectiveNoFileComp)))
3333
rootCommand.PersistentFlags().StringArrayVarP(&redirects, "redirect", "r", []string{}, "Specifies redirect rules for target process (see 'dlv help redirect')")
34-
@@ -1250,3 +1254,14 @@ func must(err error) {
34+
@@ -1249,3 +1253,14 @@ func must(err error) {
3535
log.Fatal(err)
3636
}
3737
}

go/skaffold.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,14 @@ profiles:
8686
docker:
8787
buildArgs:
8888
GOVERSION: '1.23'
89+
- op: add
90+
path: /build/artifacts/-
91+
value:
92+
image: go124app
93+
context: test/goapp
94+
docker:
95+
buildArgs:
96+
GOVERSION: '1.24'
8997

9098
deploy:
9199
kubectl:
@@ -96,6 +104,7 @@ profiles:
96104
- test/k8s-test-go121.yaml
97105
- test/k8s-test-go122.yaml
98106
- test/k8s-test-go123.yaml
107+
- test/k8s-test-go124.yaml
99108

100109
# release: pushes images to production with :latest
101110
- name: release

go/test/k8s-test-go124.yaml

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# This test approximates `skaffold debug` for a go app.
2+
apiVersion: v1
3+
kind: Pod
4+
metadata:
5+
name: go124pod
6+
labels:
7+
app: hello
8+
protocol: dlv
9+
runtime: go124
10+
spec:
11+
containers:
12+
- name: go124app
13+
image: go124app
14+
args:
15+
- /dbg/go/bin/dlv
16+
- exec
17+
- --log
18+
- --headless
19+
- --continue
20+
- --accept-multiclient
21+
# listen on 0.0.0.0 as it is exposed as a service
22+
- --listen=0.0.0.0:56286
23+
- --api-version=2
24+
- ./app
25+
ports:
26+
- containerPort: 8080
27+
- containerPort: 56286
28+
name: dlv
29+
readinessProbe:
30+
httpGet:
31+
path: /
32+
port: 8080
33+
volumeMounts:
34+
- mountPath: /dbg
35+
name: go-debugging-support
36+
initContainers:
37+
- image: skaffold-debug-go
38+
name: install-go-support
39+
resources: {}
40+
volumeMounts:
41+
- mountPath: /dbg
42+
name: go-debugging-support
43+
volumes:
44+
- emptyDir: {}
45+
name: go-debugging-support
46+
47+
---
48+
apiVersion: v1
49+
kind: Service
50+
metadata:
51+
name: hello-dlv-go124
52+
spec:
53+
ports:
54+
- name: http
55+
port: 8080
56+
protocol: TCP
57+
- name: dlv
58+
port: 56286
59+
protocol: TCP
60+
selector:
61+
app: hello
62+
protocol: dlv
63+
runtime: go124
64+
65+
---
66+
apiVersion: batch/v1
67+
kind: Job
68+
metadata:
69+
name: connect-to-go124
70+
labels:
71+
project: container-debug-support
72+
type: integration-test
73+
spec:
74+
ttlSecondsAfterFinished: 10
75+
backoffLimit: 1
76+
template:
77+
spec:
78+
restartPolicy: Never
79+
initContainers:
80+
- name: wait-for-go124
81+
image: kubectl
82+
command: [sh, -c, "while ! curl -s hello-dlv-go124:8080 2>/dev/null; do echo waiting for app; sleep 1; done"]
83+
containers:
84+
- name: dlv-to-go124
85+
image: skaffold-debug-go
86+
command: [sh, -c, '
87+
(echo bt; echo exit -c) > init.txt;
88+
set -x;
89+
/duct-tape/go/bin/dlv connect --init init.txt hello-dlv-go124:56286']

0 commit comments

Comments
 (0)