Skip to content

fix(cloud): propagate build-time version to tunnel handshake#545

Merged
nadaverell merged 1 commit intomainfrom
fix/cloud-version-ldflags-propagation
Apr 26, 2026
Merged

fix(cloud): propagate build-time version to tunnel handshake#545
nadaverell merged 1 commit intomainfrom
fix/cloud-version-ldflags-propagation

Conversation

@nadaverell
Copy link
Copy Markdown
Contributor

Summary

  • Dockerfile + Makefile inject -X main.version=$VERSION into cmd/explorer, but the cloud dialer reads internal/cloud.Version when sending the X-Radar-Version header on the tunnel handshake.
  • Mismatch meant prod images built as 1.5.5 advertised themselves to radar-hub as "dev" — the Cloud UI Clusters table shows VERSION=dev across the fleet and the upgrade-available banner never fires.
  • One-line fix: mirror version into cloud.Version at the top of main() so the existing ldflags target stays the single source of truth (rather than adding a second -X symbol that future build paths could forget).

Test plan

  • Local go build ./cmd/explorer succeeds.
  • After release + rolling the prod cluster's Radar pod, clusters.radar_version (captured at tunnel-accept) flips from NULL/dev to 1.5.x and the Cloud UI Clusters table shows the real version.
  • Upgrade-available banner fires once a newer release is published and a stale agent is still connected.

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).
@nadaverell nadaverell requested a review from hisco as a code owner April 26, 2026 23:12
@nadaverell nadaverell merged commit d597767 into main Apr 26, 2026
7 checks passed
@nadaverell nadaverell deleted the fix/cloud-version-ldflags-propagation branch April 26, 2026 23:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant