Skip to content

Commit 96c0e45

Browse files
authored
fix: send role=logstream-kube to skip connection monitoring (#168)
coder-logstream-kube connects to the agent RPC endpoint using the agent token, which triggers connection monitoring in coderd and causes false connectivity state changes (disconnected_at/first_connected_at updates). This leads to VSCode/JetBrains disconnections and incorrect dashboard status. coder/coder PR #22052 added a role query parameter to the RPC endpoint. We now check the server version via the buildinfo endpoint: if the server is v2.31.0 or newer (which includes the role support), we use ConnectRPC28WithRole("logstream-kube") to skip connection monitoring. For older servers, we fall back to ConnectRPC20. Also migrates cdr.dev/slog to cdr.dev/slog/v3 as required by the updated coder SDK, and adds the ReportBoundaryLogs stub to the test fake. Fixes coder/coder#21625
1 parent 5dc7460 commit 96c0e45

7 files changed

Lines changed: 244 additions & 202 deletions

File tree

.github/workflows/ci.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ jobs:
3535
- name: Setup Go
3636
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v6
3737
with:
38-
go-version: "~1.24"
38+
go-version: "~1.25"
3939

4040
- name: Test
4141
run: go test ./... -race
@@ -49,12 +49,12 @@ jobs:
4949
- name: Setup Go
5050
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v6
5151
with:
52-
go-version: "~1.24"
52+
go-version: "~1.25"
5353

5454
- name: golangci-lint
5555
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
5656
with:
57-
version: v2.1.6
57+
version: v2.9.0
5858

5959
integration-test:
6060
runs-on: ubuntu-latest
@@ -66,7 +66,7 @@ jobs:
6666
- name: Setup Go
6767
uses: actions/setup-go@d35c59abb061a4a6fb18e82ac0862c26744d6ab5 # v6
6868
with:
69-
go-version: "~1.24"
69+
go-version: "~1.25"
7070

7171
- name: Create KinD cluster
7272
uses: helm/kind-action@92086f6be054225fa813e0a4b13787fc9088faab # v1.13.0

go.mod

Lines changed: 43 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
module github.com/coder/coder-logstream-kube
22

3-
go 1.24.10
3+
go 1.25.7
44

55
// Required to import the agentsdk!
66
replace tailscale.com => github.com/coder/tailscale v1.1.1-0.20250829055706-6eafe0f9199e
77

88
require (
9-
cdr.dev/slog v1.6.2-0.20250703074222-9df5e0a6c145
9+
cdr.dev/slog/v3 v3.0.0-rc1
1010
github.com/breml/rootcerts v0.3.1
11-
github.com/coder/coder/v2 v2.29.3
11+
github.com/coder/coder/v2 v2.10.1-0.20260218084406-f016d9e50553
1212
github.com/coder/quartz v0.3.0
1313
github.com/coder/serpent v0.13.0
1414
github.com/coder/websocket v1.8.14
@@ -17,15 +17,15 @@ require (
1717
github.com/google/uuid v1.6.0
1818
github.com/hashicorp/yamux v0.1.2
1919
github.com/stretchr/testify v1.11.1
20-
google.golang.org/protobuf v1.36.10
20+
golang.org/x/mod v0.33.0
21+
google.golang.org/protobuf v1.36.11
2122
k8s.io/api v0.34.1
2223
k8s.io/apimachinery v0.34.1
2324
k8s.io/client-go v0.34.1
2425
storj.io/drpc v0.0.34
2526
)
2627

2728
require (
28-
cdr.dev/slog/v3 v3.0.0-rc1 // indirect
2929
cloud.google.com/go/compute/metadata v0.9.0 // indirect
3030
filippo.io/edwards25519 v1.1.0 // indirect
3131
github.com/DataDog/appsec-internal-go v1.11.2 // indirect
@@ -56,12 +56,12 @@ require (
5656
github.com/ammario/tlru v0.4.0 // indirect
5757
github.com/apparentlymart/go-textseg/v15 v15.0.0 // indirect
5858
github.com/armon/go-radix v1.0.1-0.20221118154546-54df44f2176c // indirect
59-
github.com/aws/aws-sdk-go-v2 v1.40.0 // indirect
59+
github.com/aws/aws-sdk-go-v2 v1.41.1 // indirect
6060
github.com/aws/aws-sdk-go-v2/config v1.32.1 // indirect
6161
github.com/aws/aws-sdk-go-v2/credentials v1.19.1 // indirect
6262
github.com/aws/aws-sdk-go-v2/feature/ec2/imds v1.18.14 // indirect
63-
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.14 // indirect
64-
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.14 // indirect
63+
github.com/aws/aws-sdk-go-v2/internal/configsources v1.4.17 // indirect
64+
github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.7.17 // indirect
6565
github.com/aws/aws-sdk-go-v2/internal/ini v1.8.4 // indirect
6666
github.com/aws/aws-sdk-go-v2/service/internal/accept-encoding v1.13.3 // indirect
6767
github.com/aws/aws-sdk-go-v2/service/internal/presigned-url v1.13.14 // indirect
@@ -70,20 +70,23 @@ require (
7070
github.com/aws/aws-sdk-go-v2/service/sso v1.30.4 // indirect
7171
github.com/aws/aws-sdk-go-v2/service/ssooidc v1.35.9 // indirect
7272
github.com/aws/aws-sdk-go-v2/service/sts v1.41.1 // indirect
73-
github.com/aws/smithy-go v1.23.2 // indirect
73+
github.com/aws/smithy-go v1.24.0 // indirect
7474
github.com/aymanbagabas/go-osc52/v2 v2.0.1 // indirect
7575
github.com/aymerick/douceur v0.2.0 // indirect
7676
github.com/beorn7/perks v1.0.1 // indirect
77-
github.com/brianvoe/gofakeit/v7 v7.9.0 // indirect
77+
github.com/brianvoe/gofakeit/v7 v7.14.0 // indirect
7878
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
7979
github.com/cenkalti/backoff/v5 v5.0.3 // indirect
8080
github.com/cespare/xxhash/v2 v2.3.0 // indirect
81-
github.com/charmbracelet/colorprofile v0.2.3-0.20250311203215-f60798e515dc // indirect
81+
github.com/charmbracelet/colorprofile v0.4.1 // indirect
8282
github.com/charmbracelet/lipgloss v1.1.1-0.20250404203927-76690c660834 // indirect
83-
github.com/charmbracelet/x/ansi v0.8.0 // indirect
84-
github.com/charmbracelet/x/cellbuf v0.0.13 // indirect
85-
github.com/charmbracelet/x/term v0.2.1 // indirect
83+
github.com/charmbracelet/x/ansi v0.11.6 // indirect
84+
github.com/charmbracelet/x/cellbuf v0.0.15 // indirect
85+
github.com/charmbracelet/x/term v0.2.2 // indirect
8686
github.com/cihub/seelog v0.0.0-20170130134532-f561c5e57575 // indirect
87+
github.com/clipperhouse/displaywidth v0.9.0 // indirect
88+
github.com/clipperhouse/stringish v0.1.1 // indirect
89+
github.com/clipperhouse/uax29/v2 v2.5.0 // indirect
8790
github.com/coder/pretty v0.0.0-20230908205945-e89ba86370e0 // indirect
8891
github.com/coder/retry v1.5.1 // indirect
8992
github.com/coder/terraform-provider-coder/v2 v2.13.1 // indirect
@@ -92,10 +95,10 @@ require (
9295
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
9396
github.com/dustin/go-humanize v1.0.1 // indirect
9497
github.com/eapache/queue/v2 v2.0.0-20230407133247-75960ed334e4 // indirect
95-
github.com/ebitengine/purego v0.8.4 // indirect
98+
github.com/ebitengine/purego v0.9.1 // indirect
9699
github.com/emicklei/go-restful/v3 v3.12.2 // indirect
97100
github.com/fxamacker/cbor/v2 v2.9.0 // indirect
98-
github.com/gabriel-vasile/mimetype v1.4.10 // indirect
101+
github.com/gabriel-vasile/mimetype v1.4.12 // indirect
99102
github.com/go-ini/ini v1.67.0 // indirect
100103
github.com/go-jose/go-jose/v4 v4.1.3 // indirect
101104
github.com/go-logr/logr v1.4.3 // indirect
@@ -106,7 +109,7 @@ require (
106109
github.com/go-openapi/swag v0.23.1 // indirect
107110
github.com/go-playground/locales v0.14.1 // indirect
108111
github.com/go-playground/universal-translator v0.18.1 // indirect
109-
github.com/go-playground/validator/v10 v10.28.0 // indirect
112+
github.com/go-playground/validator/v10 v10.30.0 // indirect
110113
github.com/go-viper/mapstructure/v2 v2.4.0 // indirect
111114
github.com/gobwas/glob v0.2.3 // indirect
112115
github.com/godbus/dbus/v5 v5.1.0 // indirect
@@ -139,28 +142,27 @@ require (
139142
github.com/josharian/native v1.1.1-0.20230202152459-5c7d0dd6ab86 // indirect
140143
github.com/jsimonetti/rtnetlink v1.3.5 // indirect
141144
github.com/json-iterator/go v1.1.12 // indirect
142-
github.com/klauspost/compress v1.18.1 // indirect
145+
github.com/klauspost/compress v1.18.2 // indirect
143146
github.com/kortschak/wol v0.0.0-20200729010619-da482cc4850a // indirect
144147
github.com/leodido/go-urn v1.4.0 // indirect
145148
github.com/lucasb-eyer/go-colorful v1.3.0 // indirect
146149
github.com/lufia/plan9stats v0.0.0-20250317134145-8bc96cf8fc35 // indirect
147150
github.com/mailru/easyjson v0.9.1 // indirect
148151
github.com/mattn/go-colorable v0.1.14 // indirect
149152
github.com/mattn/go-isatty v0.0.20 // indirect
150-
github.com/mattn/go-runewidth v0.0.16 // indirect
153+
github.com/mattn/go-runewidth v0.0.19 // indirect
151154
github.com/mdlayher/genetlink v1.3.2 // indirect
152155
github.com/mdlayher/netlink v1.7.2 // indirect
153156
github.com/mdlayher/sdnotify v1.0.0 // indirect
154157
github.com/mdlayher/socket v0.5.0 // indirect
155158
github.com/microcosm-cc/bluemonday v1.0.27 // indirect
156-
github.com/miekg/dns v1.1.58 // indirect
159+
github.com/miekg/dns v1.1.72 // indirect
157160
github.com/mitchellh/copystructure v1.2.0 // indirect
158161
github.com/mitchellh/go-ps v1.0.0 // indirect
159162
github.com/mitchellh/go-testing-interface v1.14.1 // indirect
160163
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
161164
github.com/mitchellh/mapstructure v1.5.1-0.20231216201459-8508981c8b6c // indirect
162165
github.com/mitchellh/reflectwalk v1.0.2 // indirect
163-
github.com/moby/moby v28.5.0+incompatible // indirect
164166
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
165167
github.com/modern-go/reflect2 v1.0.3-0.20250322232337-35a7c28c31ee // indirect
166168
github.com/muesli/termenv v0.16.0 // indirect
@@ -185,7 +187,7 @@ require (
185187
github.com/rivo/uniseg v0.4.7 // indirect
186188
github.com/robfig/cron/v3 v3.0.1 // indirect
187189
github.com/secure-systems-lab/go-securesystemslib v0.9.0 // indirect
188-
github.com/shirou/gopsutil/v4 v4.25.5 // indirect
190+
github.com/shirou/gopsutil/v4 v4.26.1 // indirect
189191
github.com/sirupsen/logrus v1.9.3 // indirect
190192
github.com/spaolacci/murmur3 v1.1.0 // indirect
191193
github.com/spf13/pflag v1.0.10 // indirect
@@ -198,10 +200,10 @@ require (
198200
github.com/tchap/go-patricia/v2 v2.3.2 // indirect
199201
github.com/tcnksm/go-httpstat v0.2.0 // indirect
200202
github.com/tinylib/msgp v1.2.5 // indirect
201-
github.com/tklauser/go-sysconf v0.3.15 // indirect
202-
github.com/tklauser/numcpus v0.10.0 // indirect
203+
github.com/tklauser/go-sysconf v0.3.16 // indirect
204+
github.com/tklauser/numcpus v0.11.0 // indirect
203205
github.com/u-root/uio v0.0.0-20240209044354-b3d14b93376a // indirect
204-
github.com/valyala/fasthttp v1.68.0 // indirect
206+
github.com/valyala/fasthttp v1.69.0 // indirect
205207
github.com/vektah/gqlparser/v2 v2.5.28 // indirect
206208
github.com/vishvananda/netlink v1.2.1-beta.2 // indirect
207209
github.com/vishvananda/netns v0.0.4 // indirect
@@ -223,13 +225,13 @@ require (
223225
go.opentelemetry.io/collector/pdata v1.27.0 // indirect
224226
go.opentelemetry.io/collector/pdata/pprofile v0.121.0 // indirect
225227
go.opentelemetry.io/collector/semconv v0.123.0 // indirect
226-
go.opentelemetry.io/otel v1.38.0 // indirect
228+
go.opentelemetry.io/otel v1.39.0 // indirect
227229
go.opentelemetry.io/otel/exporters/otlp/otlptrace v1.37.0 // indirect
228230
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.37.0 // indirect
229-
go.opentelemetry.io/otel/metric v1.38.0 // indirect
230-
go.opentelemetry.io/otel/sdk v1.38.0 // indirect
231-
go.opentelemetry.io/otel/trace v1.38.0 // indirect
232-
go.opentelemetry.io/proto/otlp v1.7.0 // indirect
231+
go.opentelemetry.io/otel/metric v1.39.0 // indirect
232+
go.opentelemetry.io/otel/sdk v1.39.0 // indirect
233+
go.opentelemetry.io/otel/trace v1.39.0 // indirect
234+
go.opentelemetry.io/proto/otlp v1.7.1 // indirect
233235
go.uber.org/atomic v1.11.0 // indirect
234236
go.uber.org/goleak v1.3.1-0.20240429205332-517bace7cc29 // indirect
235237
go.uber.org/multierr v1.11.0 // indirect
@@ -238,24 +240,23 @@ require (
238240
go.yaml.in/yaml/v3 v3.0.4 // indirect
239241
go4.org/mem v0.0.0-20220726221520-4f986261bf13 // indirect
240242
go4.org/netipx v0.0.0-20230728180743-ad4cb58a6516 // indirect
241-
golang.org/x/crypto v0.45.0 // indirect
243+
golang.org/x/crypto v0.48.0 // indirect
242244
golang.org/x/exp v0.0.0-20251023183803-a4bb9ffd2546 // indirect
243-
golang.org/x/mod v0.30.0 // indirect
244-
golang.org/x/net v0.47.0 // indirect
245-
golang.org/x/oauth2 v0.33.0 // indirect
246-
golang.org/x/sync v0.18.0 // indirect
247-
golang.org/x/sys v0.38.0 // indirect
248-
golang.org/x/term v0.37.0 // indirect
249-
golang.org/x/text v0.31.0 // indirect
245+
golang.org/x/net v0.50.0 // indirect
246+
golang.org/x/oauth2 v0.35.0 // indirect
247+
golang.org/x/sync v0.19.0 // indirect
248+
golang.org/x/sys v0.41.0 // indirect
249+
golang.org/x/term v0.40.0 // indirect
250+
golang.org/x/text v0.34.0 // indirect
250251
golang.org/x/time v0.14.0 // indirect
251-
golang.org/x/tools v0.39.0 // indirect
252+
golang.org/x/tools v0.42.0 // indirect
252253
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
253254
golang.zx2c4.com/wintun v0.0.0-20230126152724-0fa3db229ce2 // indirect
254255
golang.zx2c4.com/wireguard/windows v0.5.3 // indirect
255256
google.golang.org/appengine v1.6.8 // indirect
256-
google.golang.org/genproto/googleapis/api v0.0.0-20251022142026-3a174f9686a8 // indirect
257-
google.golang.org/genproto/googleapis/rpc v0.0.0-20251103181224-f26f9409b101 // indirect
258-
google.golang.org/grpc v1.77.0 // indirect
257+
google.golang.org/genproto/googleapis/api v0.0.0-20260128011058-8636f8732409 // indirect
258+
google.golang.org/genproto/googleapis/rpc v0.0.0-20260203192932-546029d2fa20 // indirect
259+
google.golang.org/grpc v1.79.1 // indirect
259260
gopkg.in/DataDog/dd-trace-go.v1 v1.74.0 // indirect
260261
gopkg.in/evanphx/json-patch.v4 v4.12.0 // indirect
261262
gopkg.in/inf.v0 v0.9.1 // indirect

0 commit comments

Comments
 (0)