Commit 4fb928b
committed
feat(gateway): report build_commit in /v1/info (fleet freshness)
The semver Version ("0.1.0-poc") is identical across rebuilds of the same tag,
so it can't tell whether an instance is running the latest image. Stamp the git
short-SHA into the binary at build time and surface it as /v1/info.build_commit,
so the fleet dashboard can flag out-of-date instances.
- api: BuildCommit var (default "dev", set via -ldflags -X) + Info.build_commit.
- Dockerfile: ARG GIT_COMMIT → ldflags -X …/internal/api.BuildCommit.
- gateway-image.yml: pass build-args GIT_COMMIT=${{ github.sha }}.
Verified the ldflags value lands in the binary; api tests pass.1 parent 9dc7058 commit 4fb928b
3 files changed
Lines changed: 19 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
78 | 82 | | |
79 | 83 | | |
80 | 84 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
28 | 31 | | |
29 | 32 | | |
30 | 33 | | |
31 | | - | |
| 34 | + | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
36 | 45 | | |
37 | 46 | | |
38 | 47 | | |
| |||
49 | 58 | | |
50 | 59 | | |
51 | 60 | | |
| 61 | + | |
52 | 62 | | |
53 | 63 | | |
54 | 64 | | |
| |||
91 | 101 | | |
92 | 102 | | |
93 | 103 | | |
| 104 | + | |
94 | 105 | | |
95 | 106 | | |
96 | 107 | | |
| |||
0 commit comments