File tree 3 files changed +101
-3
lines changed
3 files changed +101
-3
lines changed Original file line number Diff line number Diff line change 1
- ARG GOVERSION=1.19
1
+ ARG GOVERSION=1.20
2
2
FROM --platform=$BUILDPLATFORM golang:${GOVERSION} as delve
3
3
ARG BUILDPLATFORM
4
4
ARG TARGETOS
5
5
ARG TARGETARCH
6
6
7
- ARG DELVE_VERSION=1.9 .1
7
+ ARG DELVE_VERSION=1.20 .1
8
8
9
9
# Patch delve to make defaults for --check-go-version and --only-same-user
10
10
# to be set at build time. We must install patch(1) to apply the patch.
11
11
#
12
12
# We default --check-go-version to false to support binaries compiled
13
13
# with unsupported versions of Go. Delve issues a prominent warning.
14
- #
14
+ #
15
15
# We default --only-same-user to false as `kubectl port-forward`
16
16
# to dlv port is refused otherwise.
17
17
RUN apt-get update && apt-get install -y --no-install-recommends \
Original file line number Diff line number Diff line change @@ -94,6 +94,14 @@ profiles:
94
94
docker :
95
95
buildArgs :
96
96
GOVERSION : 1.19
97
+ - op : add
98
+ path : /build/artifacts/-
99
+ value :
100
+ image : go120app
101
+ context : test/goapp
102
+ docker :
103
+ buildArgs :
104
+ GOVERSION : ' 1.20'
97
105
deploy :
98
106
kubectl :
99
107
manifests :
@@ -104,6 +112,7 @@ profiles:
104
112
- test/k8s-test-go117.yaml
105
113
- test/k8s-test-go118.yaml
106
114
- test/k8s-test-go119.yaml
115
+ - test/k8s-test-go120.yaml
107
116
108
117
# release: pushes images to production with :latest
109
118
- name : release
Original file line number Diff line number Diff line change
1
+ # This test approximates `skaffold debug` for a go app.
2
+ apiVersion : v1
3
+ kind : Pod
4
+ metadata :
5
+ name : go120pod
6
+ labels :
7
+ app : hello
8
+ protocol : dlv
9
+ runtime : go120
10
+ spec :
11
+ containers :
12
+ - name : go120app
13
+ image : go120app
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-go120
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 : go120
64
+
65
+ ---
66
+ apiVersion : batch/v1
67
+ kind : Job
68
+ metadata :
69
+ name : connect-to-go120
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-go120
81
+ image : kubectl
82
+ command : [sh, -c, "while ! curl -s hello-dlv-go120:8080 2>/dev/null; do echo waiting for app; sleep 1; done"]
83
+ containers :
84
+ - name : dlv-to-go120
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-go120:56286']
You can’t perform that action at this time.
0 commit comments