fix(cloud): propagate build-time version to tunnel handshake#545
Merged
nadaverell merged 1 commit intomainfrom Apr 26, 2026
Merged
fix(cloud): propagate build-time version to tunnel handshake#545nadaverell merged 1 commit intomainfrom
nadaverell merged 1 commit intomainfrom
Conversation
Dockerfile and Makefile inject `-X main.version=$VERSION`, but the cloud dialer reads `internal/cloud.Version` (a separate package-level var) when stamping the `X-Radar-Version` header on the tunnel handshake. Result: prod images built as 1.5.5 advertise themselves to radar-hub as "dev", and the Cloud UI Clusters table shows VERSION=dev across the fleet (and the upgrade-available banner never fires). Mirror `version` into `cloud.Version` at the top of main() so there's a single ldflags target. Existing connected agents pick up the fix on next reconnect (header is captured at tunnel-accept time).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
-X main.version=$VERSIONintocmd/explorer, but the cloud dialer readsinternal/cloud.Versionwhen sending theX-Radar-Versionheader on the tunnel handshake."dev"— the Cloud UI Clusters table shows VERSION=dev across the fleet and the upgrade-available banner never fires.versionintocloud.Versionat the top ofmain()so the existing ldflags target stays the single source of truth (rather than adding a second-Xsymbol that future build paths could forget).Test plan
go build ./cmd/explorersucceeds.clusters.radar_version(captured at tunnel-accept) flips from NULL/devto1.5.xand the Cloud UI Clusters table shows the real version.