Skip to content

Commit

Permalink
chore: cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
ArcticLampyrid committed Nov 14, 2024
1 parent b0f074d commit 28a40c0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions hscontrol/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (h *Headscale) VerifyHandler(
) {
if req.Method != http.MethodPost {
http.Error(writer, "Wrong method", http.StatusMethodNotAllowed)

return
}
log.Debug().
Expand Down
4 changes: 3 additions & 1 deletion integration/dsic/dsic.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ func WithOrCreateNetwork(network *dockertest.Network) Option {

network, err := dockertestutil.GetFirstOrCreateNetwork(
tsic.pool,
fmt.Sprintf("%s-network", tsic.hostname),
tsic.hostname+"-network",
)
if err != nil {
log.Fatalf("failed to create network: %s", err)
Expand Down Expand Up @@ -226,6 +226,7 @@ func New(
return nil, fmt.Errorf("failed to write TLS key to container: %w", err)
}
}

return dsic, nil
}

Expand All @@ -239,6 +240,7 @@ func (t *DERPServerInContainer) Shutdown() error {
fmt.Errorf("failed to save log: %w", err),
)
}

return t.pool.Purge(t.container)
}

Expand Down
11 changes: 6 additions & 5 deletions integration/tsic/tsic.go
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ func (t *TailscaleInContainer) watchIPN(ctx context.Context) (*ipn.Notify, error

func (t *TailscaleInContainer) DebugDERPRegion(region string) (*ipnstate.DebugDERPRegionReport, error) {
if !util.TailscaleVersionNewerOrEqual("1.34", t.version) {
panic(fmt.Sprintf("tsic.DebugDERPRegion() called with unsupported version: %s", t.version))
panic("tsic.DebugDERPRegion() called with unsupported version: " + t.version)
}

command := []string{
Expand All @@ -687,17 +687,18 @@ func (t *TailscaleInContainer) DebugDERPRegion(region string) (*ipnstate.DebugDE

result, stderr, err := t.Execute(command)
if err != nil {
fmt.Printf("stderr: %s\n", stderr)
fmt.Printf("stderr: %s\n", stderr) // nolint

return nil, fmt.Errorf("failed to execute tailscale debug derp command: %w", err)
}

var st ipnstate.DebugDERPRegionReport
err = json.Unmarshal([]byte(result), &st)
var report ipnstate.DebugDERPRegionReport
err = json.Unmarshal([]byte(result), &report)
if err != nil {
return nil, fmt.Errorf("failed to unmarshal tailscale derp region report: %w", err)
}

return &st, err
return &report, err
}

// Netcheck returns the current Netcheck Report (netcheck.Report) of the Tailscale instance.
Expand Down

0 comments on commit 28a40c0

Please sign in to comment.