Skip to content

chore: show server install.sh on cli version mismatch #16668

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 3 commits into from
Feb 25, 2025
Merged
Changes from 1 commit
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
Next Next commit
chore: show server install.sh on cli version mismatch
  • Loading branch information
ethanndickson committed Feb 25, 2025
commit 8912370328e7b4dd502dc35dd04a8c85192940d4
10 changes: 7 additions & 3 deletions cli/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -1213,9 +1213,13 @@ func wrapTransportWithVersionMismatchCheck(rt http.RoundTripper, inv *serpent.In
return
}
upgradeMessage := defaultUpgradeMessage(semver.Canonical(serverVersion))
serverInfo, err := getBuildInfo(inv.Context())
if err == nil && serverInfo.UpgradeMessage != "" {
upgradeMessage = serverInfo.UpgradeMessage
if serverInfo, err := getBuildInfo(inv.Context()); err == nil {
switch {
case serverInfo.UpgradeMessage != "":
upgradeMessage = serverInfo.UpgradeMessage
case serverInfo.DashboardURL != "":
upgradeMessage = fmt.Sprintf("download the server version with: 'curl -fsSL %s/install.sh | sh'", serverInfo.DashboardURL)
}
}
fmtWarningText := "version mismatch: client %s, server %s\n%s"
fmtWarn := pretty.Sprint(cliui.DefaultStyles.Warn, fmtWarningText)
Expand Down