Skip to content
Open
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
1 change: 1 addition & 0 deletions changelogs/unreleased/3555-vineetxkhurana
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CLI: Show 'N/A' for Expires column for backups in 'New' phase, instead of an incorrect past date. (#3555)
10 changes: 9 additions & 1 deletion pkg/cmd/util/output/backup_printer.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,21 @@ func printBackup(backup *velerov1api.Backup) []metav1.TableRow {
status = "Deleting"
}

// Show "N/A" for expiration if backup is in New phase
var expirationDisplay string
if status == string(velerov1api.BackupPhaseNew) {
expirationDisplay = "N/A"
} else {
expirationDisplay = humanReadableTimeFromNow(expiration)
}

row.Cells = append(row.Cells,
backup.Name,
status,
backup.Status.Errors,
backup.Status.Warnings,
backup.Status.StartTimestamp,
humanReadableTimeFromNow(expiration),
expirationDisplay,
backup.Spec.StorageLocation,
metav1.FormatLabelSelector(backup.Spec.LabelSelector),
)
Expand Down
2 changes: 2 additions & 0 deletions site/content/docs/v0.5.0/cli-reference/ark_get_backups.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ ark get backups [flags]
--vmodule moduleSpec comma-separated list of pattern=N settings for file-filtered logging
```

**Note:** For backups in the "New" state (not yet executed), the EXPIRES column will display "N/A" instead of a date, indicating that the backup is not yet eligible for expiration or garbage collection.

### SEE ALSO
* [ark get](ark_get.md) - Get ark resources