Skip to content

Commit

Permalink
style edit
Browse files Browse the repository at this point in the history
  • Loading branch information
adamancini committed Aug 21, 2023
1 parent cdbd8af commit 8f9dc83
Showing 1 changed file with 39 additions and 39 deletions.
78 changes: 39 additions & 39 deletions pkg/collect/velero.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,45 @@ type CollectVelero struct {
RBACErrors
}

type VeleroCommand struct {
ID string
Command []string
Args []string
Format string
DefaultTimeout string
}

var VeleroCommands = []VeleroCommand{
{
ID: "get-backups",
Command: []string{"/velero", "get", "backups"},
Args: []string{"-o", "json"},
Format: "json",
DefaultTimeout: "30s",
},
{
ID: "get-restores",
Command: []string{"/velero", "get", "restores"},
Args: []string{"-o", "json"},
Format: "json",
DefaultTimeout: "30s",
},
{
ID: "describe-backups",
Command: []string{"/velero", "describe", "backups"},
Args: []string{"--details", "-o", "json"},
Format: "json",
DefaultTimeout: "30s",
},
{
ID: "describe-restores",
Command: []string{"/velero", "describe", "restores"},
Args: []string{"--details", "-o", "json"},
Format: "json",
DefaultTimeout: "30s",
},
}

func (c *CollectVelero) Title() string {
return getCollectorName(c)
}
Expand Down Expand Up @@ -72,45 +111,6 @@ func (c *CollectVelero) Collect(progressChan chan<- interface{}) (CollectorResul
return output, nil
}

type VeleroCommand struct {
ID string
Command []string
Args []string
Format string
DefaultTimeout string
}

var VeleroCommands = []VeleroCommand{
{
ID: "get-backups",
Command: []string{"/velero", "get", "backups"},
Args: []string{"-o", "json"},
Format: "json",
DefaultTimeout: "30s",
},
{
ID: "get-restores",
Command: []string{"/velero", "get", "restores"},
Args: []string{"-o", "json"},
Format: "json",
DefaultTimeout: "30s",
},
{
ID: "describe-backups",
Command: []string{"/velero", "describe", "backups"},
Args: []string{"--details", "-o", "json"},
Format: "json",
DefaultTimeout: "30s",
},
{
ID: "describe-restores",
Command: []string{"/velero", "describe", "restores"},
Args: []string{"--details", "-o", "json"},
Format: "json",
DefaultTimeout: "30s",
},
}

func veleroCommandExec(ctx context.Context, progressChan chan<- interface{}, c *CollectVelero, veleroCollector *troubleshootv1beta2.Velero, pod *corev1.Pod, command VeleroCommand, output CollectorResult) error {
timeout := veleroCollector.Timeout
if timeout == "" {
Expand Down

0 comments on commit 8f9dc83

Please sign in to comment.