Skip to content

Commit

Permalink
Include sanitized transport in connectivity report
Browse files Browse the repository at this point in the history
  • Loading branch information
amircybersec committed Jan 3, 2024
1 parent 3cc71d0 commit 007862b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions x/examples/test-connectivity/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ type connectivityReport struct {
Resolver string `json:"resolver"`
Proto string `json:"proto"`
// TODO(fortuna): add sanitized transport config.
// Transport string `json:"transport"`
Transport string `json:"transport"`

// Observations
Time time.Time `json:"time"`
Expand Down Expand Up @@ -192,12 +192,16 @@ func main() {
success = true
}
debugLog.Printf("Test %v %v result: %v", proto, resolverAddress, result)
sanitizedConfig, err := config.SanitizeConfig(*transportFlag)
if err != nil {
log.Fatalf("Failed to sanitize config: %v", err)
}
var r report.Report = connectivityReport{
Resolver: resolverAddress,
Proto: proto,
Time: startTime.UTC().Truncate(time.Second),
// TODO(fortuna): Add sanitized config:
// Transport: config.SanitizedConfig(*transportFlag),
Transport: sanitizedConfig,
DurationMs: testDuration.Milliseconds(),
Error: makeErrorRecord(result),
}
Expand Down

0 comments on commit 007862b

Please sign in to comment.