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
8 changes: 4 additions & 4 deletions tool/tsh/common/tsh.go
Original file line number Diff line number Diff line change
Expand Up @@ -4368,12 +4368,12 @@ func printLoginInformation(cf *CLIConf, profile *client.ProfileStatus, profiles
if len(accessListsToReview) > 0 {
fmt.Printf("Access lists that need to be reviewed:\n")
for _, accessList := range accessListsToReview {
d := time.Until(accessList.Spec.Audit.NextAuditDate).Round(time.Minute)
var msg string
if d > 0 {
msg = fmt.Sprintf("%v left to review", d.String())
nextAuditDate := accessList.Spec.Audit.NextAuditDate.Format(time.DateOnly)
if time.Now().After(accessList.Spec.Audit.NextAuditDate) {
msg = fmt.Sprintf("review is overdue (%v)", nextAuditDate)
} else {
msg = fmt.Sprintf("review was required %v ago", (-d).String())
msg = fmt.Sprintf("review is required by %v", nextAuditDate)
}
fmt.Printf("\t%s (%v)\n", accessList.Spec.Title, msg)
}
Expand Down