TUN-8786: calculate cli flags once for the diagnostic procedure

## Summary

The flags were always being computed when their value is static.

 Closes TUN-8786
This commit is contained in:
Luis Neto
2024-12-11 01:29:20 -08:00
parent 77b99cf5fe
commit ba9f28ef43
4 changed files with 75 additions and 109 deletions

View File

@@ -25,7 +25,7 @@ func helperCreateServer(t *testing.T, listeners *gracenet.Net, tunnelID uuid.UUI
require.NoError(t, err)
log := zerolog.Nop()
tracker := tunnelstate.NewConnTracker(&log)
handler := diagnostic.NewDiagnosticHandler(&log, 0, nil, tunnelID, connectorID, tracker, nil, []string{}, []string{})
handler := diagnostic.NewDiagnosticHandler(&log, 0, nil, tunnelID, connectorID, tracker, map[string]string{}, []string{})
router := http.NewServeMux()
router.HandleFunc("/diag/tunnel", handler.TunnelStateHandler)
server := &http.Server{