Skip to content
Merged
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
6 changes: 5 additions & 1 deletion tool/tsh/tsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -3786,10 +3786,14 @@ func onShow(cf *CLIConf) error {
// printStatus prints the status of the profile.
func printStatus(debug bool, p *profileInfo, env map[string]string, isActive bool) {
var prefix string
duration := time.Until(p.ValidUntil)
humanDuration := "EXPIRED"
duration := time.Until(p.ValidUntil)
if duration.Nanoseconds() > 0 {
humanDuration = fmt.Sprintf("valid for %v", duration.Round(time.Minute))
// If certificate is valid for less than a minute, display "<1m" instead of "0s".
if duration < time.Minute {
humanDuration = "valid for <1m"
}
}

proxyURL := p.getProxyURLLine(isActive, env)
Expand Down