mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-25 11:05:45 +00:00
version: add GitCommitTime to Meta
Updates tailscale/corp#1297 Signed-off-by: Maisem Ali <maisem@tailscale.com>
This commit is contained in:
parent
359ef61263
commit
8feb4ff5d2
@ -230,6 +230,9 @@ type Meta struct {
|
||||
// daemon, if requested.
|
||||
DaemonLong string `json:"daemonLong,omitempty"`
|
||||
|
||||
// GitCommitTime is the commit time of the git commit in GitCommit.
|
||||
GitCommitTime string `json:"gitCommitTime,omitempty"`
|
||||
|
||||
// Cap is the current Tailscale capability version. It's a monotonically
|
||||
// incrementing integer that's incremented whenever a new capability is
|
||||
// added.
|
||||
@ -245,6 +248,7 @@ func GetMeta() Meta {
|
||||
MajorMinorPatch: majorMinorPatch(),
|
||||
Short: Short(),
|
||||
Long: Long(),
|
||||
GitCommitTime: getEmbeddedInfo().commitTime,
|
||||
GitCommit: gitCommit(),
|
||||
GitDirty: gitDirty(),
|
||||
ExtraGitCommit: extraGitCommitStamp,
|
||||
|
@ -105,6 +105,7 @@ type embeddedInfo struct {
|
||||
valid bool
|
||||
commit string
|
||||
commitDate string
|
||||
commitTime string
|
||||
dirty bool
|
||||
}
|
||||
|
||||
@ -126,6 +127,7 @@ func (i embeddedInfo) commitAbbrev() string {
|
||||
case "vcs.revision":
|
||||
ret.commit = s.Value
|
||||
case "vcs.time":
|
||||
ret.commitTime = s.Value
|
||||
if len(s.Value) >= len("yyyy-mm-dd") {
|
||||
ret.commitDate = s.Value[:len("yyyy-mm-dd")]
|
||||
ret.commitDate = strings.ReplaceAll(ret.commitDate, "-", "")
|
||||
|
Loading…
Reference in New Issue
Block a user