Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ec4c78e

Browse files
committed
fixup! fix status
1 parent 0abe0a1 commit ec4c78e

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

cli/speedtest.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func speedtest() *cobra.Command {
7575
if err != nil {
7676
continue
7777
}
78-
status := conn.Status(true)
78+
status := conn.Status()
7979
if len(status.Peers()) != 1 {
8080
continue
8181
}

scaletest/agentconn/run.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (r *Runner) Run(ctx context.Context, _ string, logs io.Writer) error {
8787

8888
// Ensure DERP for completeness.
8989
if r.cfg.ConnectionMode == ConnectionModeDerp {
90-
status := conn.Status(true)
90+
status := conn.Status()
9191
if len(status.Peers()) != 1 {
9292
return xerrors.Errorf("check connection mode: expected 1 peer, got %d", len(status.Peers()))
9393
}
@@ -172,7 +172,7 @@ func waitForDirectConnection(ctx context.Context, logs io.Writer, conn *codersdk
172172

173173
for i := 0; i < directConnectionAttempts; i++ {
174174
_, _ = fmt.Fprintf(logs, "\tDirect connection check %d/%d...\n", i+1, directConnectionAttempts)
175-
status := conn.Status(true)
175+
status := conn.Status()
176176

177177
var err error
178178
if len(status.Peers()) != 1 {

tailnet/conn.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ func (c *Conn) RemoveAllPeers() error {
353353
func (c *Conn) UpdateNodes(nodes []*Node) error {
354354
c.mutex.Lock()
355355
defer c.mutex.Unlock()
356-
status := c.Status(true)
356+
status := c.Status()
357357
for _, peer := range c.netMap.Peers {
358358
peerStatus, ok := status.Peer[peer.Key]
359359
if !ok {
@@ -424,8 +424,8 @@ func (c *Conn) UpdateNodes(nodes []*Node) error {
424424
}
425425

426426
// Status returns the current ipnstate of a connection.
427-
func (c *Conn) Status(wantPeers bool) *ipnstate.Status {
428-
sb := &ipnstate.StatusBuilder{WantPeers: wantPeers}
427+
func (c *Conn) Status() *ipnstate.Status {
428+
sb := &ipnstate.StatusBuilder{WantPeers: true}
429429
c.wireguardEngine.UpdateStatus(sb)
430430
return sb.Status()
431431
}

0 commit comments

Comments
 (0)