From 04364ef2ca0174f4f80c38a3393882d34d3127af Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Mon, 22 Dec 2025 22:59:17 -0800 Subject: [PATCH 1/2] Update the logging to print correct affinity field Signed-off-by: Lubron Zhan --- pkg/exposer/csi_snapshot.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pkg/exposer/csi_snapshot.go b/pkg/exposer/csi_snapshot.go index d20638d7a..6127260c6 100644 --- a/pkg/exposer/csi_snapshot.go +++ b/pkg/exposer/csi_snapshot.go @@ -259,7 +259,13 @@ func (e *csiSnapshotExposer) Expose(ctx context.Context, ownerObject corev1api.O return errors.Wrap(err, "error to create backup pod") } - curLog.WithField("pod name", backupPod.Name).WithField("affinity", csiExposeParam.Affinity).Info("Backup pod is created") + curLog = curLog.WithField("pod name", backupPod.Name) + if affinity != nil { + curLog = curLog.WithField("affinity", *affinity) + } else { + curLog = curLog.WithField("affinity", "nil") + } + curLog.Info("Backup pod is created") defer func() { if err != nil { From 0d80995e6294e4dfb93912e4aed11a414033c3d8 Mon Sep 17 00:00:00 2001 From: Lubron Zhan Date: Mon, 22 Dec 2025 22:59:17 -0800 Subject: [PATCH 2/2] Update the logging to print correct affinity field Signed-off-by: Lubron Zhan --- pkg/exposer/csi_snapshot.go | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/pkg/exposer/csi_snapshot.go b/pkg/exposer/csi_snapshot.go index 6127260c6..5acb229d2 100644 --- a/pkg/exposer/csi_snapshot.go +++ b/pkg/exposer/csi_snapshot.go @@ -259,13 +259,7 @@ func (e *csiSnapshotExposer) Expose(ctx context.Context, ownerObject corev1api.O return errors.Wrap(err, "error to create backup pod") } - curLog = curLog.WithField("pod name", backupPod.Name) - if affinity != nil { - curLog = curLog.WithField("affinity", *affinity) - } else { - curLog = curLog.WithField("affinity", "nil") - } - curLog.Info("Backup pod is created") + curLog.WithField("pod name", backupPod.Name).WithField("affinity", affinity).Info("Backup pod is created") defer func() { if err != nil {