From 0d27d5258ff72606bf2b193e1f7fc338d7992bfc Mon Sep 17 00:00:00 2001 From: hu-keyu Date: Fri, 14 Mar 2025 06:14:05 +0800 Subject: [PATCH] issue8720: log doesn't show pv name (#8771) * fix: log doesn't show pv name Signed-off-by: hu-keyu * fix: add changelog Signed-off-by: hu-keyu * update changelog fileName Signed-off-by: hu-keyu --------- Signed-off-by: hu-keyu --- changelogs/unreleased/8771-hu-keyu | 1 + .../Extend-VolumePolicies-to-support-more-actions.md | 2 +- internal/volumehelper/volume_policy_helper.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 changelogs/unreleased/8771-hu-keyu diff --git a/changelogs/unreleased/8771-hu-keyu b/changelogs/unreleased/8771-hu-keyu new file mode 100644 index 000000000..87438767f --- /dev/null +++ b/changelogs/unreleased/8771-hu-keyu @@ -0,0 +1 @@ +Log doesn't show pv name, but displays %!s(MISSING) instead \ No newline at end of file diff --git a/design/Implemented/Extend-VolumePolicies-to-support-more-actions.md b/design/Implemented/Extend-VolumePolicies-to-support-more-actions.md index 7997b6288..e1503dba5 100644 --- a/design/Implemented/Extend-VolumePolicies-to-support-more-actions.md +++ b/design/Implemented/Extend-VolumePolicies-to-support-more-actions.md @@ -276,7 +276,7 @@ func (v *volumeHelperImpl) ShouldPerformSnapshot(obj runtime.Unstructured, group if !boolptr.IsSetToFalse(v.snapshotVolumes) { // If the backup.Spec.SnapshotVolumes is not set, or set to true, then should take the snapshot. - v.logger.Infof("performing snapshot action for pv %s as the snapshotVolumes is not set to false") + v.logger.Infof("performing snapshot action for pv %s as the snapshotVolumes is not set to false", pv.Name) return true, nil } diff --git a/internal/volumehelper/volume_policy_helper.go b/internal/volumehelper/volume_policy_helper.go index 13cef2fd9..520523099 100644 --- a/internal/volumehelper/volume_policy_helper.go +++ b/internal/volumehelper/volume_policy_helper.go @@ -129,7 +129,7 @@ func (v *volumeHelperImpl) ShouldPerformSnapshot(obj runtime.Unstructured, group if !boolptr.IsSetToFalse(v.snapshotVolumes) { // If the backup.Spec.SnapshotVolumes is not set, or set to true, then should take the snapshot. - v.logger.Infof("performing snapshot action for pv %s as the snapshotVolumes is not set to false") + v.logger.Infof("performing snapshot action for pv %s as the snapshotVolumes is not set to false", pv.Name) return true, nil }