From 23ca089d4033ec9a6e2e3f57b259b7be44a1b3e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wenkai=20Yin=28=E5=B0=B9=E6=96=87=E5=BC=80=29?= Date: Wed, 9 Oct 2024 14:44:13 +0800 Subject: [PATCH] Use '"' rather than '`' in the log to avoid unexpected new line MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Use '"' rather than '`' in the log to avoid unexpected new line Signed-off-by: Wenkai Yin(尹文开) --- pkg/backup/item_collector.go | 9 +++------ pkg/util/csi/volume_snapshot.go | 3 +-- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/pkg/backup/item_collector.go b/pkg/backup/item_collector.go index 84c1429ea4..a1fce5ee74 100644 --- a/pkg/backup/item_collector.go +++ b/pkg/backup/item_collector.go @@ -116,8 +116,7 @@ func (nt *nsTracker) init( for _, namespace := range unstructuredNSs { if nt.singleLabelSelector != nil && nt.singleLabelSelector.Matches(labels.Set(namespace.GetLabels())) { - nt.logger.Debugf(`Track namespace %s, - because its labels match backup LabelSelector.`, + nt.logger.Debugf("Track namespace %s, because its labels match backup LabelSelector.", namespace.GetName(), ) @@ -128,8 +127,7 @@ func (nt *nsTracker) init( if len(nt.orLabelSelector) > 0 { for _, selector := range nt.orLabelSelector { if selector.Matches(labels.Set(namespace.GetLabels())) { - nt.logger.Debugf(`Track namespace %s", - "because its labels match the backup OrLabelSelector.`, + nt.logger.Debugf("Track namespace %s, because its labels match the backup OrLabelSelector.", namespace.GetName(), ) nt.track(namespace.GetName()) @@ -148,8 +146,7 @@ func (nt *nsTracker) init( } if nt.namespaceFilter.ShouldInclude(namespace.GetName()) { - nt.logger.Debugf(`Track namespace %s, - because its name match the backup namespace filter.`, + nt.logger.Debugf("Track namespace %s, because its name match the backup namespace filter.", namespace.GetName(), ) nt.track(namespace.GetName()) diff --git a/pkg/util/csi/volume_snapshot.go b/pkg/util/csi/volume_snapshot.go index 09bfb062d3..76a4d59fa5 100644 --- a/pkg/util/csi/volume_snapshot.go +++ b/pkg/util/csi/volume_snapshot.go @@ -424,8 +424,7 @@ func GetVolumeSnapshotClassForStorageClass( return &vsClass, nil } return nil, fmt.Errorf( - `failed to get VolumeSnapshotClass for provisioner %s, - ensure that the desired VolumeSnapshot class has the %s label`, + "failed to get VolumeSnapshotClass for provisioner %s, ensure that the desired VolumeSnapshot class has the %s label", provisioner, velerov1api.VolumeSnapshotClassSelectorLabel) }