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

Skip to content

fix(cli): properly handle build log streaming during coder ping #15600

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions cli/ping.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,6 @@ func (r *RootCmd) ping() *serpent.Command {
ctx, cancel := context.WithCancel(inv.Context())
defer cancel()

spin := spinner.New(spinner.CharSets[5], 100*time.Millisecond)
spin.Writer = inv.Stderr
spin.Suffix = pretty.Sprint(cliui.DefaultStyles.Keyword, " Collecting diagnostics...")
spin.Start()

notifyCtx, notifyCancel := inv.SignalNotifyContext(ctx, StopSignals...)
defer notifyCancel()

Expand All @@ -118,10 +113,15 @@ func (r *RootCmd) ping() *serpent.Command {
workspaceName,
)
if err != nil {
spin.Stop()
return err
}

// Start spinner after any build logs have finished streaming
spin := spinner.New(spinner.CharSets[5], 100*time.Millisecond)
spin.Writer = inv.Stderr
spin.Suffix = pretty.Sprint(cliui.DefaultStyles.Keyword, " Collecting diagnostics...")
spin.Start()

opts := &workspacesdk.DialAgentOptions{}

if r.verbose {
Expand Down
7 changes: 5 additions & 2 deletions codersdk/healthsdk/interfaces.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,14 @@ func generateInterfacesReport(st *interfaces.State) (report InterfacesReport) {
continue
}
report.Interfaces = append(report.Interfaces, healthIface)
if iface.MTU < safeMTU {
// Some loopback interfaces on Windows have a negative MTU, which we can
// safely ignore in diagnostics.
if iface.MTU > 0 && iface.MTU < safeMTU {
report.Severity = health.SeverityWarning
report.Warnings = append(report.Warnings,
health.Messagef(health.CodeInterfaceSmallMTU,
"Network interface %s has MTU %d (less than %d), which may degrade the quality of direct connections", iface.Name, iface.MTU, safeMTU),
"Network interface %s has MTU %d (less than %d), which may degrade the quality of direct "+
"connections or render them unusable.", iface.Name, iface.MTU, safeMTU),
)
}
}
Expand Down
Loading