diff --git a/pkg/cmd/cli/backup/describe.go b/pkg/cmd/cli/backup/describe.go index 7d26dd963e..47132c27a3 100644 --- a/pkg/cmd/cli/backup/describe.go +++ b/pkg/cmd/cli/backup/describe.go @@ -57,6 +57,14 @@ func NewDescribeCommand(f client.Factory, use string) *cobra.Command { kbClient, err := f.KubebuilderClient() cmd.CheckError(err) + var csiClient *snapshotv1client.Clientset + if features.IsEnabled(velerov1api.CSIFeatureFlag) { + clientConfig, err := f.ClientConfig() + cmd.CheckError(err) + csiClient, err = snapshotv1client.NewForConfig(clientConfig) + cmd.CheckError(err) + } + if outputFormat != "plaintext" && outputFormat != "json" { cmd.CheckError(fmt.Errorf("invalid output format '%s'. valid value are 'plaintext, json'", outputFormat)) } @@ -96,16 +104,9 @@ func NewDescribeCommand(f client.Factory, use string) *cobra.Command { fmt.Fprintf(os.Stderr, "error getting PodVolumeBackups for backup %s: %v\n", backup.Name, err) } - var csiClient *snapshotv1client.Clientset // declare vscList up here since it may be empty and we'll pass the empty Items field into DescribeBackup vscList := new(snapshotv1api.VolumeSnapshotContentList) if features.IsEnabled(velerov1api.CSIFeatureFlag) { - clientConfig, err := f.ClientConfig() - cmd.CheckError(err) - - csiClient, err = snapshotv1client.NewForConfig(clientConfig) - cmd.CheckError(err) - opts := label.NewListOptionsForBackup(backup.Name) vscList, err = csiClient.SnapshotV1().VolumeSnapshotContents().List(context.TODO(), opts) if err != nil { diff --git a/pkg/cmd/cli/nodeagent/server.go b/pkg/cmd/cli/nodeagent/server.go index 2fa52f8917..10df06f89e 100644 --- a/pkg/cmd/cli/nodeagent/server.go +++ b/pkg/cmd/cli/nodeagent/server.go @@ -361,7 +361,7 @@ func (s *nodeAgentServer) markDataUploadsCancel(r *controller.DataUploadReconcil return } if dataUploads, err := r.FindDataUploads(s.ctx, client, s.namespace); err != nil { - s.logger.WithError(errors.WithStack(err)).Error("failed to find data downloads") + s.logger.WithError(errors.WithStack(err)).Error("failed to find data uploads") } else { for i := range dataUploads { du := dataUploads[i] @@ -463,7 +463,7 @@ func (s *nodeAgentServer) markInProgressPVRsFailed(client ctrlclient.Client) { continue } if pod.Spec.NodeName != s.nodeName { - s.logger.Debugf("the node of pod referenced by podvolumebackup %q is %q, not %q, skip", pvr.GetName(), pod.Spec.NodeName, s.nodeName) + s.logger.Debugf("the node of pod referenced by podvolumerestore %q is %q, not %q, skip", pvr.GetName(), pod.Spec.NodeName, s.nodeName) continue } diff --git a/pkg/controller/pod_volume_backup_controller.go b/pkg/controller/pod_volume_backup_controller.go index 3507a49eaa..f074e0cc25 100644 --- a/pkg/controller/pod_volume_backup_controller.go +++ b/pkg/controller/pod_volume_backup_controller.go @@ -101,8 +101,6 @@ func (r *PodVolumeBackupReconciler) Reconcile(ctx context.Context, req ctrl.Requ ) } - log.Info("PodVolumeBackup starting") - // Only process items for this node. if pvb.Spec.Node != r.nodeName { return ctrl.Result{}, nil @@ -116,6 +114,8 @@ func (r *PodVolumeBackupReconciler) Reconcile(ctx context.Context, req ctrl.Requ return ctrl.Result{}, nil } + log.Info("PodVolumeBackup starting") + callbacks := datapath.Callbacks{ OnCompleted: r.OnDataPathCompleted, OnFailed: r.OnDataPathFailed,