From 8f9dc83d1c2bae851871acfb47f11b1844926c0f Mon Sep 17 00:00:00 2001 From: ada mancini Date: Mon, 21 Aug 2023 17:06:33 -0400 Subject: [PATCH] style edit --- pkg/collect/velero.go | 78 +++++++++++++++++++++---------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/pkg/collect/velero.go b/pkg/collect/velero.go index 8bf667d1f..614002491 100644 --- a/pkg/collect/velero.go +++ b/pkg/collect/velero.go @@ -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) } @@ -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 == "" {