backup describer: show snapshot summary by default, details optionally

Signed-off-by: Steve Kriss <steve@heptio.com>
This commit is contained in:
Steve Kriss
2018-10-22 12:08:37 -06:00
parent 6ef155ddff
commit f014cab1fe
9 changed files with 100 additions and 34 deletions
+4 -4
View File
@@ -33,8 +33,8 @@ import (
func NewDescribeCommand(f client.Factory, use string) *cobra.Command {
var (
listOptions metav1.ListOptions
volumeDetails bool
listOptions metav1.ListOptions
details bool
)
c := &cobra.Command{
@@ -71,7 +71,7 @@ func NewDescribeCommand(f client.Factory, use string) *cobra.Command {
fmt.Fprintf(os.Stderr, "error getting PodVolumeBackups for backup %s: %v\n", backup.Name, err)
}
s := output.DescribeBackup(&backup, deleteRequestList.Items, podVolumeBackupList.Items, volumeDetails)
s := output.DescribeBackup(&backup, deleteRequestList.Items, podVolumeBackupList.Items, details, arkClient)
if first {
first = false
fmt.Print(s)
@@ -84,7 +84,7 @@ func NewDescribeCommand(f client.Factory, use string) *cobra.Command {
}
c.Flags().StringVarP(&listOptions.LabelSelector, "selector", "l", listOptions.LabelSelector, "only show items matching this label selector")
c.Flags().BoolVar(&volumeDetails, "volume-details", volumeDetails, "display details of restic volume backups")
c.Flags().BoolVar(&details, "details", details, "display additional detail in the command output")
return c
}
+4 -4
View File
@@ -32,8 +32,8 @@ import (
func NewDescribeCommand(f client.Factory, use string) *cobra.Command {
var (
listOptions metav1.ListOptions
volumeDetails bool
listOptions metav1.ListOptions
details bool
)
c := &cobra.Command{
@@ -64,7 +64,7 @@ func NewDescribeCommand(f client.Factory, use string) *cobra.Command {
fmt.Fprintf(os.Stderr, "error getting PodVolumeRestores for restore %s: %v\n", restore.Name, err)
}
s := output.DescribeRestore(&restore, podvolumeRestoreList.Items, volumeDetails, arkClient)
s := output.DescribeRestore(&restore, podvolumeRestoreList.Items, details, arkClient)
if first {
first = false
fmt.Print(s)
@@ -77,7 +77,7 @@ func NewDescribeCommand(f client.Factory, use string) *cobra.Command {
}
c.Flags().StringVarP(&listOptions.LabelSelector, "selector", "l", listOptions.LabelSelector, "only show items matching this label selector")
c.Flags().BoolVar(&volumeDetails, "volume-details", volumeDetails, "display details of restic volume restores")
c.Flags().BoolVar(&details, "details", details, "display additional detail in the command output")
return c
}