Update the logging to print correct affinity field

Signed-off-by: Lubron Zhan <lubronzhan@gmail.com>
This commit is contained in:
Lubron Zhan
2025-12-30 11:00:49 -08:00
parent 3b5118b45e
commit 04364ef2ca
+7 -1
View File
@@ -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 {