cmd/tailscale, ipn/localapi: get daemon version from localapi status

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2021-03-18 21:07:58 -07:00
parent d0dffe33c0
commit 439d70dce2
5 changed files with 104 additions and 58 deletions

View File

@@ -26,7 +26,14 @@ import (
// Status represents the entire state of the IPN network.
type Status struct {
// Version is the daemon's long version (see version.Long).
Version string
// BackendState is an ipn.State string value:
// "NoState", "NeedsLogin", "NeedsMachineAuth", "Stopped",
// "Starting", "Running".
BackendState string
AuthURL string // current URL provided by control to authorize client
TailscaleIPs []netaddr.IP // Tailscale IP(s) assigned to this node
Self *PeerStatus
@@ -105,6 +112,12 @@ type StatusBuilder struct {
st Status
}
func (sb *StatusBuilder) SetVersion(v string) {
sb.mu.Lock()
defer sb.mu.Unlock()
sb.st.Version = v
}
func (sb *StatusBuilder) SetBackendState(v string) {
sb.mu.Lock()
defer sb.mu.Unlock()