mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-11 21:27:31 +00:00
control/controlclient: de-pointer Status.PersistView, document more
Updates #cleanup Updates #1909 Change-Id: I31d91e120e3b299508de2136021eab3b34131a44 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
7053e19562
commit
f5bfdefa00
@@ -21,7 +21,6 @@ import (
|
||||
"tailscale.com/types/logger"
|
||||
"tailscale.com/types/netmap"
|
||||
"tailscale.com/types/persist"
|
||||
"tailscale.com/types/ptr"
|
||||
"tailscale.com/types/structs"
|
||||
)
|
||||
|
||||
@@ -644,9 +643,9 @@ func (c *Auto) sendStatus(who string, err error, url string, nm *netmap.NetworkM
|
||||
|
||||
c.logf("[v1] sendStatus: %s: %v", who, state)
|
||||
|
||||
var p *persist.PersistView
|
||||
var p persist.PersistView
|
||||
if nm != nil && loggedIn && synced {
|
||||
p = ptr.To(c.direct.GetPersist())
|
||||
p = c.direct.GetPersist()
|
||||
} else {
|
||||
// don't send netmap status, as it's misleading when we're
|
||||
// not logged in.
|
||||
|
@@ -61,12 +61,24 @@ func (s State) String() string {
|
||||
}
|
||||
|
||||
type Status struct {
|
||||
_ structs.Incomparable
|
||||
Err error
|
||||
URL string // interactive URL to visit to finish logging in
|
||||
NetMap *netmap.NetworkMap // server-pushed configuration
|
||||
_ structs.Incomparable
|
||||
|
||||
Persist *persist.PersistView // locally persisted configuration
|
||||
// Err, if non-nil, is an error that occurred while logging in.
|
||||
//
|
||||
// If it's of type UserVisibleError then it's meant to be shown to users in
|
||||
// their Tailscale client. Otherwise it's just logged to tailscaled's logs.
|
||||
Err error
|
||||
|
||||
// URL, if non-empty, is the interactive URL to visit to finish logging in.
|
||||
URL string
|
||||
|
||||
// NetMap is the latest server-pushed state of the tailnet network.
|
||||
NetMap *netmap.NetworkMap
|
||||
|
||||
// Persist, when Valid, is the locally persisted configuration.
|
||||
//
|
||||
// TODO(bradfitz,maisem): clarify this.
|
||||
Persist persist.PersistView
|
||||
|
||||
// state is the internal state. It should not be exposed outside this
|
||||
// package, but we have some automated tests elsewhere that need to
|
||||
|
Reference in New Issue
Block a user